Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
This project is now read‑only. Starting Monday, February 2, please use https://ibm-ceph.atlassian.net/ for all bug tracking management.

Bug 1509035

Summary: On the NFS mount, sub-directories getting created using 'cd' if a similar named child-directory is present.
Product: [Red Hat Storage] Red Hat Ceph Storage Reporter: Vidushi Mishra <vimishra>
Component: RGWAssignee: Matt Benjamin (redhat) <mbenjamin>
Status: CLOSED ERRATA QA Contact: ceph-qe-bugs <ceph-qe-bugs>
Severity: medium Docs Contact:
Priority: high    
Version: 3.0CC: cbodley, ceph-eng-bugs, hnallurv, kbader, kdreyer, mbenjamin, owasserm, sweil, tserlin
Target Milestone: rc   
Target Release: 3.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: RHEL: ceph-12.2.1-39.el7cp Ubuntu: ceph_12.2.1-41redhat1xenial Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-12-05 23:49:35 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Vidushi Mishra 2017-11-02 18:51:01 UTC
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

Comment 14 errata-xmlrpc 2017-12-05 23:49:35 UTC
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