diff options
author | Vijay Bellur <vijay@gluster.com> | 2009-10-14 14:00:07 +0000 |
---|---|---|
committer | Anand V. Avati <avati@dev.gluster.com> | 2009-10-15 09:03:35 -0700 |
commit | 4203033c2da0598712d34389f8ef5ce8c24334b4 (patch) | |
tree | 74766c5831500df24e8fc8a50ec4c94cac09c1d8 /xlators/mount | |
parent | 347385beb519d75cd1457a36cf13a02fd2e60a92 (diff) |
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 <avati@dev.gluster.com>
BUG: 296 (handle futimes correctly in FUSE)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=296
Diffstat (limited to 'xlators/mount')
-rw-r--r-- | xlators/mount/fuse/src/fuse-bridge.c | 4 |
1 files changed, 3 insertions, 1 deletions
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; |