Description of problem: ======================= After enabling USS on the volume where few snapshots were taken, from NFS mount, unable to access the first snapshot under .snaps directory Version-Release number of selected component (if applicable): ============================================================== glusterfs 3.6.0.30 How reproducible: ================ 3/3 Steps to Reproduce: ================= 1.Create a 2x2 dist rep volume(vol0)and start it 2.Fuse and NFS mount the volume, enable USS on the volume and create some IO -created dir1 and few files under them created nfs_dir1 and few files under them 3.Take snapshot of the volume (snap1) 4.Create some more IO and take few more snapshots 5.From fuse mount cd to .snaps and list the snaps [root@dhcp-0-97 dir2]# cd .snaps [root@dhcp-0-97 .snaps]# ll total 0 d---------. 0 root root 0 Jan 1 1970 snap1 d---------. 0 root root 0 Jan 1 1970 snap2 d---------. 0 root root 0 Jan 1 1970 snap3 [root@dhcp-0-97 .snaps]# cd snap2 [root@dhcp-0-97 snap2]# pwd /mnt/vol0_fuse/dir2/.snaps/snap2 From NFS mount cd to .snaps and list the snaps [root@dhcp-0-97 vol0_nfs]# ll total 0 drwxr-xr-x. 2 root root 102 Nov 5 14:17 dir1 drwxr-xr-x. 2 root root 45 Nov 5 14:18 dir2 drwxr-xr-x. 2 root root 142 Nov 5 14:19 dir3 drwxr-xr-x. 2 root root 62 Nov 5 14:18 nfs_dir1 drwxr-xr-x. 2 root root 132 Nov 5 14:19 nfs_dir2 drwxr-xr-x. 2 root root 132 Nov 5 14:20 nfs_dir3 [root@dhcp-0-97 vol0_nfs]# cd nfs_dir2 [root@dhcp-0-97 nfs_dir2]# cd .snaps [root@dhcp-0-97 .snaps]# ll ls: cannot access snap1: No such file or directory total 0 ??????????? ? ? ? ? ? snap1 drwxr-xr-x. 2 root root 132 Nov 5 14:19 snap2 drwxr-xr-x. 2 root root 132 Nov 5 14:19 snap3 [root@dhcp-0-97 .snaps]# cd snap1 bash: cd: snap1: No such file or directory [root@dhcp-0-97 .snaps]# cd snap2/ [root@dhcp-0-97 snap2]# ls nfs11 nfs12 nfs13 nfs14 nfs15 nfs16 nfs17 nfs18 nfs19 nfs20 Actual results: =============== From NFS mount unable to access the first snapshot under .snaps Expected results: ================ All the snaps should be listed and accessible under .snaps Additional info:
the testcase mentioned in the description, dir 'nfs_dir2' is not part of snap1, so lookup will fails with ESTALE. NFS does getattr (stat) on all the files retrieved from readdir for caching. As snap1 doesn't contain dir 'nfs_dir2' it gets ESTALE and marks snap1 negative. Even in FUSE mount, snap1 will be listed. but cd to snap1 will not work. This is explained in 'https://bugzilla.redhat.com/show_bug.cgi?id=1159302#c4'.
As vijaykumar explained in the 3rd comment, this happens because, nfs client upon getting readdir responses, sends getattr on each of the entries it received. Now, since the directory nfs_dir2 (or to be more specific the gfid of nfs_dir2) is not present in snap1, getattr operation on that gfid in snap1 will fail and nfs client will send the o/p in the way mentioned in the bug description.
Hi Vijai, Can you review the edited doc text for technical accuracy and sign off?
Hi Pavithra, I have edited the doc-text. We can enter into '.snaps' directory but not into '.snaps/snapname/'
*** Bug 1159302 has been marked as a duplicate of this bug. ***
This is an expected behavior and not a bug, so closing the bug If the current directory '/dir' is not a part of the snapshot say 'snap1', then the user cannot enter the '/dir/.snaps/snap1' directory.