Bug 842549 - getattr command from NFS xlator does not make hard link file in .glusterfs directory
getattr command from NFS xlator does not make hard link file in .glusterfs di...
Status: CLOSED DUPLICATE of bug 852566
Product: GlusterFS
Classification: Community
Component: nfs (Show other bugs)
3.3.0
Unspecified Unspecified
unspecified Severity high
: ---
: ---
Assigned To: Rajesh
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-07-24 03:33 EDT by Teruaki Ishizaki
Modified: 2013-07-04 18:44 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-11-15 00:50:45 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Teruaki Ishizaki 2012-07-24 03:33:37 EDT
Description of problem:
If a file of glusterfs´s brick doesn´t have hard link in .glusterfs/XX/YY/ and doing "ls -la" command about 3times to NFS mount point of glusterfs, we can't get the attribute information of files.

[root@gluster01 ~]# ls -la /mnt/
ls: cannot access /mnt/ccc: No such file or directory
ls: cannot access /mnt/aaa: No such file or directory
ls: cannot access /mnt/bbb: No such file or directory
ls: cannot access /mnt/ddd: No such file or directory
total 32
drwxr-xr-x   4 root root  4096 Jul 24 07:02 .
dr-xr-xr-x. 27 root root  4096 Jul 23 01:04 ..
-??????????  ? ?    ?        ?            ? aaa
-??????????  ? ?    ?        ?            ? bbb
-??????????  ? ?    ?        ?            ? ccc
-??????????  ? ?    ?        ?            ? ddd
drwx------   2 root root 16384 Jul  1 08:08 lost+found

[root@gluster01 ~]# find /gluster/.glusterfs/
/gluster/.glusterfs/
/gluster/.glusterfs/00
/gluster/.glusterfs/00/00
/gluster/.glusterfs/00/00/00000000-0000-0000-0000-000000000001

After read a file, gluster makes hard link and get attribute information successfully.

[root@gluster01 ~]# cat /mnt/aaa

[root@gluster01 ~]# ls -la /mnt/
ls: cannot access /mnt/ccc: No such file or directory
ls: cannot access /mnt/bbb: No such file or directory
ls: cannot access /mnt/ddd: No such file or directory
total 32
drwxr-xr-x   4 root root  4096 Jul 24 07:02 .
dr-xr-xr-x. 27 root root  4096 Jul 23 01:04 ..
-rw-r--r--   1 root root     0 Jul 23 01:10 aaa
-??????????  ? ?    ?        ?            ? bbb
-??????????  ? ?    ?        ?            ? ccc
-??????????  ? ?    ?        ?            ? ddd
drwx------   2 root root 16384 Jul  1 08:08 lost+found


In addition, if we use fuse mount and do "ls -la" command, gluster makes hard link in .glusterfs/XX/XX and get attribute information successfully.

Version-Release number of selected component (if applicable):
glusterfs-3.3.0-1.el6.x86_64
glusterfs-server-3.3.0-1.el6.x86_64

How reproducible:
100% reproducible

Steps to Reproduce:
1.Make files in glusterfs mount point
2.Stop gluster volume and gluster service
3.rm -rf <gluster_brick>/.glusterfs in all bricks
4.Start gluster service and gluster service
5.Do "ls -la" command about 3 times
6.Mount the volume with NFS.

Actual results:
We can't get attribute of files and directory.

Expected results:
We get attribute of files and directory successfully.

Additional info:
Our system had gluster-3.2.1 storage and updated to gluster-3.3.0.
Gluster-3.3 has a new feature of DHT with using hard link in .glusterfs/XX/YY directory.

Files maked when we used gluster-3.2.1 system don't have hard link for gluster-3.3.0 and the problem was happen.

Getattr of NFS xlator should make hard link if the file of hard link isn't exist.
Comment 1 Krishna Srinivas 2012-10-22 05:19:29 EDT
The reason this happens is because "ls" readdirp reply returns FH without filling the dentry cache. When the next operation on the FH happens (like getattr) the loc->path will not be available and hence posix_getattr call relies on the hardlink/gfid resulting in this error.

Bug 835034 happens because of the same reason.
Comment 2 Rajesh 2012-11-15 00:50:45 EST

*** This bug has been marked as a duplicate of bug 852566 ***

Note You need to log in before you can comment on or make changes to this bug.