From 2f8a834e7b6acef73795237d6c6269eb9838de53 Mon Sep 17 00:00:00 2001 From: Shehjar Tikoo Date: Fri, 31 Jul 2009 04:14:48 +0000 Subject: libglusterfsclient: Invalidate iattr cache on reads Earlier we have invalidated the iattr cache on writes. Now we need to do so for reads also, so that we are not updating the iattr cache with 0-filled stat received from io-cache. Signed-off-by: Anand V. Avati BUG: 180 (fileop fails at chmod with stale file handle error over unfs3) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=180 --- libglusterfsclient/src/libglusterfsclient.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'libglusterfsclient') diff --git a/libglusterfsclient/src/libglusterfsclient.c b/libglusterfsclient/src/libglusterfsclient.c index cf85ba90284..187df1b7625 100755 --- a/libglusterfsclient/src/libglusterfsclient.c +++ b/libglusterfsclient/src/libglusterfsclient.c @@ -3219,8 +3219,7 @@ libgf_client_read (libglusterfs_client_ctx_t *ctx, } stbuf = &stub->args.readv_cbk.stbuf; libgf_transform_devnum (ctx, stbuf); - libgf_update_iattr_cache (fd->inode, LIBGF_UPDATE_STAT, - stbuf); + libgf_invalidate_iattr_cache (fd->inode, LIBGF_INVALIDATE_STAT); } call_stub_destroy (stub); @@ -3346,8 +3345,7 @@ libgf_client_readv (libglusterfs_client_ctx_t *ctx, stbuf = &stub->args.readv_cbk.stbuf; libgf_transform_devnum (ctx, stbuf); - libgf_update_iattr_cache (local->fd->inode, LIBGF_UPDATE_STAT, - stbuf); + libgf_invalidate_iattr_cache (fd->inode, LIBGF_UPDATE_STAT); } call_stub_destroy (stub); -- cgit