diff options
author | Vijay Bellur <vijay@gluster.com> | 2009-10-23 08:37:29 +0000 |
---|---|---|
committer | Anand V. Avati <avati@dev.gluster.com> | 2009-10-23 07:40:34 -0700 |
commit | 10dea439359238aed4dbad0e2c25df9fb2d5f28e (patch) | |
tree | dc4ad45ad7754b5c34d6f671a0a759a21921cddc /xlators/mount/fuse | |
parent | a5219b99db8076dc8606a44fd1cfaf2bd69a0d31 (diff) |
mount/fuse: Don't use fsi if it is already cleaned up
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
BUG: 146 (Add setattr FOP)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=146
Diffstat (limited to 'xlators/mount/fuse')
-rw-r--r-- | xlators/mount/fuse/src/fuse-bridge.c | 5 |
1 files changed, 4 insertions, 1 deletions
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; |