From 10dea439359238aed4dbad0e2c25df9fb2d5f28e Mon Sep 17 00:00:00 2001 From: Vijay Bellur Date: Fri, 23 Oct 2009 08:37:29 +0000 Subject: mount/fuse: Don't use fsi if it is already cleaned up Signed-off-by: Anand V. Avati BUG: 146 (Add setattr FOP) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=146 --- xlators/mount/fuse/src/fuse-bridge.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'xlators/mount/fuse') diff --git a/xlators/mount/fuse/src/fuse-bridge.c b/xlators/mount/fuse/src/fuse-bridge.c index 5ec80796a1e..e28128278a1 100644 --- a/xlators/mount/fuse/src/fuse-bridge.c +++ b/xlators/mount/fuse/src/fuse-bridge.c @@ -1027,6 +1027,7 @@ fuse_setattr (xlator_t *this, fuse_in_header_t *finh, void *msg) fuse_state_t *state = NULL; int32_t ret = -1; + int32_t valid = 0; GET_STATE (this, finh, state); @@ -1049,6 +1050,8 @@ fuse_setattr (xlator_t *this, fuse_in_header_t *finh, void *msg) "%"PRIu64": SETATTR (%"PRIu64")%s", finh->unique, finh->nodeid, state->loc.path); + valid = fsi->valid; + if ((fsi->valid & FATTR_SIZE) && ((fsi->valid & (FATTR_MASK)) != FATTR_SIZE)) { state->callcount = 2; @@ -1060,7 +1063,7 @@ fuse_setattr (xlator_t *this, fuse_in_header_t *finh, void *msg) fuse_do_truncate (state, fsi); } - if ((fsi->valid & (FATTR_MASK)) != FATTR_SIZE) { + if ((valid & (FATTR_MASK)) != FATTR_SIZE) { attr.st_size = fsi->size; attr.st_atime = fsi->atime; attr.st_mtime = fsi->mtime; -- cgit