From 6bfbcf7326a1261c8ff7cde9fd2c76a55cf756ae Mon Sep 17 00:00:00 2001 From: Vikas Gorur Date: Tue, 27 Oct 2009 08:47:28 +0000 Subject: mount/fuse: Derive fd from the file handle for setattr 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 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/xlators/mount/fuse/src/fuse-bridge.c b/xlators/mount/fuse/src/fuse-bridge.c index 7ff39ec3f..18e51a7fa 100644 --- a/xlators/mount/fuse/src/fuse-bridge.c +++ b/xlators/mount/fuse/src/fuse-bridge.c @@ -1057,7 +1057,9 @@ fuse_setattr (xlator_t *this, fuse_in_header_t *finh, void *msg) state->callcount = 2; } - state->fd = fd_lookup (state->loc.inode, finh->pid); + if (fsi->valid & FATTR_FH) { + state->fd = FH_TO_FD (fsi->fh); + } if (fsi->valid & FATTR_SIZE) { fuse_do_truncate (state, fsi); -- cgit