Bug 761898 (GLUSTER-166) - libglusterfsclient: Cached stat buf inode is different from ino in inode_t
Summary: libglusterfsclient: Cached stat buf inode is different from ino in inode_t
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: GLUSTER-166
Product: GlusterFS
Classification: Community
Component: libglusterfsclient
Version: 2.0.3
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Shehjar Tikoo
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-07-25 23:53 UTC by Shehjar Tikoo
Modified: 2009-08-12 06:03 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed:
Regression: RTP
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:


Attachments (Terms of Use)

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)


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