Description of problem:
After creating directories on the NFS mount, was able to create child-directories using 'cd'. This happens particularly when child-directories with almost the similar name-format are present.
Problem explained below:
[root@magna024 ubuntu]# mount -t nfs -o vers=4 magna024:/ /mnt/ganesha_v4
[root@magna024 ubuntu]# cd /mnt/ganesha_v4
[root@magna024 ganesha_v4]# ll
total 0
[root@magna024 ganesha_v4]# mkdir test1 >>>> parent directory
[root@magna024 ganesha_v4]# cd test1/
[root@magna024 test1]# ll
total 0
[root@magna024 test1]# mkdir ganesha1 >>>> child-directory
[root@magna024 test1]# mkdir ganesha2
[root@magna024 test1]# mkdir ganesha3
Now, try creating a child-directory via 'cd' with name as a substring of already present directories (say ganesha).
-------------------------------------------------------------------------------
[root@magna024 test1]# cd ganesha
[root@magna024 ganesha]# touch file1
[root@magna024 ganesha]# vi file1
[root@magna024 ganesha]# cat file1
hello file1
[root@magna024 ganesha]# pwd
/mnt/ganesha_v4/test1/ganesha
[root@magna024 ganesha]# cd ..
[root@magna024 test1]# ll
total 0
drwxrwxrwx. 1 root root 0 Nov 2 17:41 ganesha
drwxr-xr-x. 1 root root 0 Nov 2 17:40 ganesha1
drwxr-xr-x. 1 root root 0 Nov 2 17:40 ganesha2
drwxr-xr-x. 1 root root 0 Nov 2 17:40 ganesha3
[root@magna024 test1]
[root@magna024 test1]# ll ganesha
total 0
-rw-r--r--. 1 root root 12 Nov 2 17:41 file1
[root@magna024 test1]#
Try creating another child-directory say (gane)
------------------------------------------------
[root@magna024 test1]# cd gane
[root@magna024 gane]#
[root@magna024 gane]# vi file_a
[root@magna024 gane]# cat file_a
dhaijdsalkjsadjkd;lsak;cksa
[root@magna024 gane]# pwd
/mnt/ganesha_v4/test1/gane
[root@magna024 gane]# cd ..
[root@magna024 test1]# ll gane/file_a
-rw-r--r--. 1 root root 28 Nov 2 17:43 gane/file_a
[root@magna024 test1]# cat gane/file_a
dhaijdsalkjsadjkd;lsak;cksa
[root@magna024 test1]# ll
total 0
drwxrwxrwx. 1 root root 0 Nov 2 17:40 gane
drwxrwxrwx. 3 root root 0 Nov 2 17:41 ganesha
drwxr-xr-x. 1 root root 0 Nov 2 17:40 ganesha1
drwxr-xr-x. 1 root root 0 Nov 2 17:40 ganesha2
drwxr-xr-x. 1 root root 0 Nov 2 17:40 ganesha3
[root@magna024 test1]#
While, creating a child-directory via 'cd' with a name different from the ones present say (directory1), it fails with "No such file or directory" error.
[root@magna024 test1]# cd directory1
bash: cd: directory1: No such file or directory
[root@magna024 test1]# mkdir directory1
[root@magna024 test1]# mkdir directory2
[root@magna024 test1]# cd direct
[root@magna024 direct]# pwd
/mnt/ganesha_v4/test1/direct
[root@magna024 direct]# cd ..
[root@magna024 test1]#
Version-Release number of selected component (if applicable):
ceph version 12.2.1-37.el7cp
nfs-ganesha-rgw-2.5.2-13.el7cp.x86_64
nfs-ganesha-2.5.2-13.el7cp.x86_64
How reproducible:
always
Steps to Reproduce:
1. Configure NFS-RGW
2. On the mount point, create few directories and child-directiories.
3. Try creating a child-directory via 'cd' with a name as the substring of an already present child-direstories (Result: It passes.)
Actual results:
child-directories getting created via 'cd'
Expected results:
child-directories should not be via 'cd'. Should throw "No such file or directory" error.
Additional info:
Observed for both NFSv3 and NFSv4
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://access.redhat.com/errata/RHBA-2017:3387