1

I have implemented a new NAS filer recently, and after mounting it on a Linux server, the Perl interpreter (version 5.005_03) is unable to recognize the existence of files on that mount:

[root@server ~]# stat /newmount/testfile 
  File: `/newmount/testfile'
  Size: 0               Blocks: 0          IO Block: 65536  regular empty file
Device: 48h/72d Inode: 9262698097446760736  Links: 1
Access: (0644/-rw-r--r--)  Uid: (  500/ testuser)   Gid: (   500/      testuser)
Access: 2017-02-22 16:44:21.218314000 +0200
Modify: 2017-02-22 16:44:21.218314000 +0200
Change: 2017-02-22 16:44:21.218314000 +0200


[root@server ~]# perl -e 'print "File Exists\n" if -e "/newmount/testfile";'
[root@server ~]#

The interesting thing here, is this:

When I try with a newer version of the interpreter (like perl, v5.8.8) it works:

[root@server ~]# perl -e 'print "File Exists\n" if -e "/newmount/testfile";'                 
File Exists
[root@server ~]# 

What am I missing on the old Perl?

Thanks in advance!

nadavr
  • 19
  • 3
  • 5
    It's funny that v5.8.8 is not considered the old perl. – mob Feb 22 '17 at 15:06
  • 3
    It is ... and 5.005_03 is the ancient perl. – dgw Feb 22 '17 at 15:12
  • 1
    If you have a newer Perl there, why do you care? Is this just curiosity or do you need it to work with the 5.005_03 version? – simbabque Feb 22 '17 at 15:14
  • March 1999 was the release date for that version... one would have to assume if Perl is that old, that box is a few updates behind if this is indeed not just a test. – stevieb Feb 22 '17 at 15:39
  • 1
    Can you give the mount command ? Some issues exist in case of fusemount. You could also use strace to see the system calls in both versions of perl. – BOC Feb 22 '17 at 16:30
  • Yeah I know it's old.. What can I do? we must be backwards compatible to old code running on old systems (such as Solaris SPARC). This is not just a test. – nadavr Feb 22 '17 at 16:33
  • @BOC The mount is with default options, in /proc/mounts it shows: rw,vers=3,rsize=65536,wsize=65536,hard,proto=tcp,timeo=600,retrans=2,sec=sys Regarding strace, already tried it. Couldn't spot anything other than the bottom line which is a stat64 call with the same file name and options, followed by a write call with an answer (Perl 5.88) and nothing and at on perl 5.005_03 – nadavr Feb 22 '17 at 16:45
  • Did both `stat64` calls return `0`? If so, that points to a bug in Perl. – ikegami Feb 22 '17 at 17:00
  • Is your file bigger than 2GB ? Support for files bigger than 2GB was recent in 5.005_03. Can you do a perl -V and check that compiler options "-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" were set ? – BOC Feb 23 '17 at 08:38

2 Answers2

0

Thanks for anyone trying to help, I found the root cause of the issue. For anyone facing a similar issue with legacy systems, check if the storage exporting the NFS mounts is using 64-bit file descriptors. In my case, switching to 32-bit file descriptors on the storage solved the issue.

nadavr
  • 19
  • 3
0

I had a similar issue while using Perl.

The mounted nfs directory had perms of 775 and ownership of 0:788

Account running Perl had primary GID of 402 and was also a member of 788.

Error messages indicated "does not exist or is not a directory"

I changed the primary group of the active account to 788 and it began working.

Only posting in the hopes of preventing someone else from ripping out their last remaining hairs.

canyonblue77
  • 81
  • 1
  • 4