Ujjwala need to understand if this is happening on upstream code. I tried with that, and couldn't get the similar issues.
This test follows the following path: POSIX test suite + CIFS client mount point + Linux CIFS kernel client + Samba + FUSE mountpoint + Gluster + XFS Some things to note: - The Linux CIFS client supports SMB1 only, but within SMB1 it negotiates a special sub-protocol, known as the "Unix Extensions". - Unix extensions support POSIX-style symlinks (not Windows style). - The Unix Extensions provide better (but not perfect) POSIX support between client and server. Don't expect the CIFS client to provide 100% POSIX semantics. SMB is designed to provide Windows semantics. - This test should be run against Samba on XFS, so that Gluster is excluded. - This test should also be run against a Windows server, just to see how different the two server types are (and to see how much impact the Unix extensions actually have). The most likely cause of the problem is a bug in the CIFS client, although a cache coherency bug could also be a factor.
Tested it on the RHS 2.0 Update 5 build - glusterfs 3.3.0.9rhs built on May 24 2013 12:03:05 and I see the issue. # ls -al /mnt/gfs/run6944/ ls: cannot access /mnt/gfs/run6944/fstest_e7c7146923ae2c247ba22929a0ef3733: Not a directory ls: cannot access /mnt/gfs/run6944/fstest_e857c87ef9cfa67996f32f06b7d31d5e: Not a directory ls: cannot access /mnt/gfs/run6944/fstest_221aabf02e4b9271b081f39b18147722: Not a directory ls: cannot access /mnt/gfs/run6944/fstest_d2d83acf36e582497e7e8c03c0a27d07: Not a directory ls: cannot access /mnt/gfs/run6944/fstest_56fe661df1955556f210c81f05c057f7: Not a directory ls: cannot access /mnt/gfs/run6944/fstest_0325bb1491acad479c52ff45a9f55054: Not a directory ls: cannot access /mnt/gfs/run6944/fstest_d873c7daa547cd70b9b4547794ab9f02: No such file or directory ls: cannot access /mnt/gfs/run6944/fstest_38dff44dbb3ed5c963aeb9ed3ecba98d: Not a directory ls: cannot access /mnt/gfs/run6944/fstest_935c645418117c1992f63954d4160c5d: Not a directory ls: cannot access /mnt/gfs/run6944/fstest_bcc118d4c9a85671ef5c1c7244999cd7: Not a directory ls: cannot access /mnt/gfs/run6944/fstest_77712aaf1938633382230bfa7423c06c: Not a directory ls: cannot access /mnt/gfs/run6944/fstest_697decae6bee578b88fe33becec7b33c: Not a directory ls: cannot access /mnt/gfs/run6944/fstest_f5a78c09b139ff5b6b74da4c0fd34f01: Not a directory ls: cannot access /mnt/gfs/run6944/fstest_e050c2cc130f62bf0d7bd72a74af5754: Not a directory ls: cannot access /mnt/gfs/run6944/fstest_1e89502fc97df88c6b503aa7a70027eb: Not a directory ls: cannot access /mnt/gfs/run6944/fstest_f23028b58be358cfe5cf4468beb86673: Not a directory ls: cannot access /mnt/gfs/run6944/fstest_2c82ca90cb2541091583bcc5946ee7a6: Not a directory ls: cannot access /mnt/gfs/run6944/fstest_9428bdffbe1e58d44ea98514db5d8be6: Not a directory ls: cannot access /mnt/gfs/run6944/fstest_7c16307aec6b449f24e3685b2091c069: Not a directory ls: cannot access /mnt/gfs/run6944/fstest_93cfb39bd84dc9077e07f0d1546940c0: Not a directory ls: cannot access /mnt/gfs/run6944/fstest_ba2b44c7604db59932b9fa15b2fa59a0: Not a directory ls: cannot access /mnt/gfs/run6944/fstest_b34cf22456846b98e9273fc21aa23bea: Not a directory ls: cannot access /mnt/gfs/run6944/fstest_c81f10a6a45bbcdaae52030944a643c7: Not a directory total 0 drwxrwxr-x. 2 root root 0 May 27 2013 . drwxr-xr-x. 1630 root root 0 May 27 2013 .. l?????????? ? ? ? ? ? fstest_0325bb1491acad479c52ff45a9f55054 l?????????? ? ? ? ? ? fstest_1e89502fc97df88c6b503aa7a70027eb l?????????? ? ? ? ? ? fstest_221aabf02e4b9271b081f39b18147722 l?????????? ? ? ? ? ? fstest_2c82ca90cb2541091583bcc5946ee7a6 l?????????? ? ? ? ? ? fstest_38dff44dbb3ed5c963aeb9ed3ecba98d l?????????? ? ? ? ? ? fstest_56fe661df1955556f210c81f05c057f7 l?????????? ? ? ? ? ? fstest_697decae6bee578b88fe33becec7b33c l?????????? ? ? ? ? ? fstest_77712aaf1938633382230bfa7423c06c l?????????? ? ? ? ? ? fstest_7c16307aec6b449f24e3685b2091c069 l?????????? ? ? ? ? ? fstest_935c645418117c1992f63954d4160c5d l?????????? ? ? ? ? ? fstest_93cfb39bd84dc9077e07f0d1546940c0 l?????????? ? ? ? ? ? fstest_9428bdffbe1e58d44ea98514db5d8be6 l?????????? ? ? ? ? ? fstest_b34cf22456846b98e9273fc21aa23bea l?????????? ? ? ? ? ? fstest_ba2b44c7604db59932b9fa15b2fa59a0 l?????????? ? ? ? ? ? fstest_bcc118d4c9a85671ef5c1c7244999cd7 l?????????? ? ? ? ? ? fstest_c81f10a6a45bbcdaae52030944a643c7 l?????????? ? ? ? ? ? fstest_d2d83acf36e582497e7e8c03c0a27d07 l?????????? ? ? ? ? ? fstest_d873c7daa547cd70b9b4547794ab9f02 l?????????? ? ? ? ? ? fstest_e050c2cc130f62bf0d7bd72a74af5754 l?????????? ? ? ? ? ? fstest_e7c7146923ae2c247ba22929a0ef3733 l?????????? ? ? ? ? ? fstest_e857c87ef9cfa67996f32f06b7d31d5e l?????????? ? ? ? ? ? fstest_f23028b58be358cfe5cf4468beb86673 l?????????? ? ? ? ? ? fstest_f5a78c09b139ff5b6b74da4c0fd34f01 # readlink /mnt/gfs/run6944/fstest_0325bb1491acad479c52ff45a9f55054 [root@RHEL6 ~]# echo $? 1
Please test against Samba running on XFS. If the problem persists, it is likely a known bug in the Linux CIFS client.
I tested it on Samba running over XFS. The readlink command works fine on it. Command ouptut on XFS: root@RHEL6 [Jul-23-2013- 4:36:37] >touch abc root@RHEL6 [Jul-23-2013- 4:36:43] >ln -s abc xyz root@RHEL6 [Jul-23-2013- 4:36:53] >ls abc xyz root@RHEL6 [Jul-23-2013- 4:36:55] >ls -al total 0 drwxr-xr-x. 2 root root 0 Jul 23 2013 . drwxr-xr-x. 4 root root 0 Jul 23 2013 .. -rw-r--r--. 1 root root 0 Jul 23 04:36 abc lrwxrwxrwx. 1 root root 3 Jul 23 2013 xyz -> abc root@RHEL6 [Jul-23-2013- 4:36:57] >readlink xyz abc root@RHEL6 [Jul-23-2013- 4:37:06] >echo $? 0 Steps to recreate the issue on VFS mount: 1. cd into the VFS mount point. 2. >touch abc 3. >ln -s abc xyz 4. >ls -al total 48 drwxr-xr-x. 2 root root 32 Jul 23 2013 . drwxr-xr-x. 1006 root root 49152 Jul 23 2013 .. -rw-r--r--. 1 root root 0 Jul 23 04:33 abc lrwxrwxrwx. 1 root root 3 Jul 23 2013 xyz -> 5. >readlink xyz 6. >echo $? 0
I tried the tests with "unix extensions = no" set in the /etc/samba/smb.conf file. with unix extensions set to no, creating symlink is not allowed on the gluster vfs smb mount. The behavior is same on smb mount of xfs backend dir. on gluster vfs smb mount: >cd /mnt/smb2 >touch test >ls test >ln -s test abc ln: creating symbolic link `abc': Operation not supported >echo $? 1 On xfs backend dir smb mount: >cd /mnt/cifs >touch test >ls test >ln -s test abc ln: creating symbolic link `abc': Operation not supported >echo $? 1
The above results are key. This indicates that creating symbolic links is only supported if the Unix Extensions are enabled. It's a POSIX-only feature. That says two things: 1) That the problem is specific to Linux<-SMB->Linux connections and is, therefore, of lower priority. 2) That it is likely that the problem exists within the VFS layer. Another possibility is that there's a race condition in Gluster that is exposed by using the VFS layer (something that FUSE would not expose because it operates differently).
Change posted for review https://code.engineering.redhat.com/gerrit/#/c/11036/
The symlink is working fine with glusterfs-3.4.0.16rhs-1.el6rhs.x86_64 on gluster vfs cifs mount: root@RHEL6 [Aug-07-2013- 7:04:46] >touch abc root@RHEL6 [Aug-07-2013- 7:04:50] >ln -s abc xyz root@RHEL6 [Aug-07-2013- 7:04:58] >ls -al total 4 drwxr-xr-x. 4 root root 242 Aug 7 2013 . drwxr-xr-x. 3 root root 4096 Aug 7 06:51 .. -rw-r--r--. 1 root root 0 Aug 7 07:04 abc drwxr-xr-x. 2 root root 53 Aug 7 2013 run5367 lrwxrwxrwx. 1 root root 3 Aug 7 2013 xyz -> abc root@RHEL6 [Aug-07-2013- 7:06:46] >readlink xyz abc
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHBA-2013-1262.html