Bug 761898 (GLUSTER-166)

Summary: libglusterfsclient: Cached stat buf inode is different from ino in inode_t
Product: [Community] GlusterFS Reporter: Shehjar Tikoo <shehjart>
Component: libglusterfsclientAssignee: Shehjar Tikoo <shehjart>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: medium Docs Contact:
Priority: low    
Version: 2.0.3CC: gluster-bugs
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: ---
Regression: RTP Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Shehjar Tikoo 2009-07-25 23:53:04 UTC
In libglusterfsclient, while having replicate as a subvolume, it is possible that the stat buf that replicate returns on a read/write, is from a subvolume of replicate which is different from the subvolume from which the libglusterfsclient must've cached the attrs, on a previous write. This will result in the iattr cache getting the stat with a different inode.

This is a problem for unfs3booster since an lstat can be returned from the cache resulting in different inode number from the one unfs3 had cached. THis forces unfs3 to return a ESTALE.

This is a regression that has creeped in since 2.0.3 where we started updating the iattr cache on a read and write callback.


A temporary workaround is to disable caching by setting the attr_timeout option in booster fstab to 0.

Comment 1 Shehjar Tikoo 2009-07-27 02:13:14 UTC
Another temporary workaround can be to fix the read-subvolume in replicate.


The problem with simply returning a fixed inode number in readv is that the timestamps will be accurate only for that subvolume. This means that any NFS client side caching will be unpredictable because the timestamps it caches could be from a different sub-volume.

Comment 2 Anand Avati 2009-07-27 15:33:31 UTC
PATCH: http://patches.gluster.com/patch/821 in master (cluster/afr: Set inode number in unwind_buf in the inode-write calls.)

Comment 3 Anand Avati 2009-07-27 15:33:34 UTC
PATCH: http://patches.gluster.com/patch/825 in master (cluster/afr: Return same inode number in stat buf for readv_cbk)

Comment 4 Anand Avati 2009-07-27 15:33:48 UTC
PATCH: http://patches.gluster.com/patch/821 in release-2.0 (cluster/afr: Set inode number in unwind_buf in the inode-write calls.)

Comment 5 Anand Avati 2009-07-27 15:33:52 UTC
PATCH: http://patches.gluster.com/patch/826 in release-2.0 (cluster/afr: Return same inode number in stat buf for readv_cbk)