Description of problem: Files are getting disappeared from mount point while performing rm -rf from user who does not have permission to delete those files Version-Release number of selected component (if applicable): nfs-ganesha-gluster-2.4.1-7.el6rhs.x86_64 How reproducible: Consistently Steps to Reproduce: 1.Create 5 node ganesha cluster.Enable ganesha on it. 2.Create 6*2 Distributed-Replicate volume.Enable ganesha on it 3.Mount volume to client via v4. 4.Create 2 files say f1 and f2. [root@dhcp37-192 ganesha]# touch f1 [root@dhcp37-192 ganesha]# touch f2 [root@dhcp37-192 ganesha]# ls -l total 0 -rw-r--r--. 1 root root 0 Mar 6 2017 f1 -rw-r--r--. 1 root root 0 Mar 6 2017 f2 5.Change owner of the file [root@dhcp37-192 ganesha]# chown mani f1 [root@dhcp37-192 ganesha]# chown mani f2 [root@dhcp37-192 ganesha]# ls -l total 0 -rw-r--r--. 1 mani root 0 Mar 6 2017 f1 -rw-r--r--. 1 mani root 0 Mar 6 2017 f2 6.su to another user who does not hv right to delete the files [root@dhcp37-192 ganesha]# su mani1 7.Try removing the files [mani1@dhcp37-192 ganesha]$ rm -rf * rm: cannot remove ‘f1’: Permission denied rm: cannot remove ‘f2’: Permission denied 8.Do ls on mount point.Files got disappeared from mount point but are present on bricks. [mani1@dhcp37-192 ganesha]$ ls f1 f2 [mani1@dhcp37-192 ganesha]$ ls [mani1@dhcp37-192 ganesha]$ Actual results: Files are getting disappeared from mount point Expected results: Files should not be removed from mount point while performing rm -rf from user who doesn't hv access to delete those files. Additional info: Issue is observed with both MD-cache enable/disable
The issue is that mdcache is removing dirent even when unlink is unsuccessful at the sub-FSAL layer. The fix is already merged upstream - https://review.gerrithub.io/#/c/346324/ Also Manisha, there is another similar issue raised and fixed upstream - https://review.gerrithub.io/#/c/346241/ Could you try out the similar test case in downstream as well. We may need to pull in that patch as well.
Soumya, Tried the similar test case mentioned in patch. That issue is not observed in downstream glusterfs-ganesha-3.8.4-16.el6rhs.x86_64 $ mkdir -p a/b/c a/d $ touch a/b/c/d $ mv a/b/c a/d $ rm -rf a/b $ find a # find a a a/d a/d/c a/d/c/d # ls -la a/d/c total 8 drwxr-xr-x. 2 root root 4096 Mar 6 2017 . drwxr-xr-x. 3 root root 4096 Mar 6 2017 .. -rw-r--r--. 1 root root 0 Mar 6 2017 d
Verified this bug on # rpm -qa | grep ganesha nfs-ganesha-2.4.1-9.el6rhs.x86_64 glusterfs-ganesha-3.8.4-17.el6rhs.x86_64 nfs-ganesha-gluster-2.4.1-9.el6rhs.x86_64 Steps: 1.Create 5 node ganesha cluster.Enable ganesha on it. 2.Create 6*2 Distributed-Replicate volume.Enable ganesha on it 3.Mount volume to client via v4. 4.Create 2 files say f1 and f2. [root@dhcp37-192 ganesha]# touch f1 [root@dhcp37-192 ganesha]# touch f2 [root@dhcp37-192 ganesha]# ls -l total 0 -rw-r--r--. 1 root root 0 Mar 8 2017 f1 -rw-r--r--. 1 root root 0 Mar 8 2017 f2 5.Change owner of the file [root@dhcp37-192 ganesha]# chown ms f1 [root@dhcp37-192 ganesha]# chown ms f2 [root@dhcp37-192 ganesha]# ls -l total 0 -rw-r--r--. 1 ms root 0 Mar 8 2017 f1 -rw-r--r--. 1 ms root 0 Mar 8 2017 f2 6.su to another user who does not hv right to delete the files [root@dhcp37-192 ganesha]# su mani1 7.Try removing the files [mani1@dhcp37-192 ganesha]$ rm -rf * rm: cannot remove ‘f1’: Permission denied rm: cannot remove ‘f2’: Permission denied 8.Do ls on mount point. [mani1@dhcp37-192 ganesha]$ ls f1 f2 [mani1@dhcp37-192 ganesha]$ ls f1 f2 Files are visible on mount point. As the issue is no more observed with this build,moving this bug to verified state.
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. https://rhn.redhat.com/errata/RHEA-2017-0493.html