From cc58f457acfc452d8076b273c9bdab6cf0f9bb29 Mon Sep 17 00:00:00 2001 From: Shehjar Tikoo Date: Fri, 31 Jul 2009 04:15:13 +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/src/libglusterfsclient.c') diff --git a/libglusterfsclient/src/libglusterfsclient.c b/libglusterfsclient/src/libglusterfsclient.c index b63b2bc7a..a680e240f 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