From 4203033c2da0598712d34389f8ef5ce8c24334b4 Mon Sep 17 00:00:00 2001 From: Vijay Bellur Date: Wed, 14 Oct 2009 14:00:07 +0000 Subject: mount/fuse: Initialize attr and set nsec values for atime and mtime. attr was not being initialized and NSEC values were not being set in attr. These were being referenced in posix_do_utimes which could cause a failure of utimes (). Signed-off-by: Anand V. Avati BUG: 296 (handle futimes correctly in FUSE) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=296 --- xlators/mount/fuse/src/fuse-bridge.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'xlators/mount') diff --git a/xlators/mount/fuse/src/fuse-bridge.c b/xlators/mount/fuse/src/fuse-bridge.c index e53f6809033..7ff2a9b2de3 100644 --- a/xlators/mount/fuse/src/fuse-bridge.c +++ b/xlators/mount/fuse/src/fuse-bridge.c @@ -1142,7 +1142,7 @@ fuse_setattr (xlator_t *this, fuse_in_header_t *finh, void *msg) { struct fuse_setattr_in *fsi = msg; - struct stat attr; + struct stat attr = {0, }; fuse_state_t *state = NULL; int32_t ret = -1; @@ -1183,6 +1183,8 @@ fuse_setattr (xlator_t *this, fuse_in_header_t *finh, void *msg) attr.st_size = fsi->size; attr.st_atime = fsi->atime; attr.st_mtime = fsi->mtime; + ST_ATIM_NSEC_SET (&attr, fsi->atimensec); + ST_MTIM_NSEC_SET (&attr, fsi->mtimensec); attr.st_mode = fsi->mode; attr.st_uid = fsi->uid; -- cgit