mount/fuse: Don't send fsetattr if ATIME or MTIME needs to be changed.

There is no "futimes" call. Hence, if either the FATTR_MTIME or FATTR_ATIME
flag is set, don't send fsetattr.

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
This commit is contained in:
Vikas Gorur 2009-10-05 09:25:33 +00:00 committed by Anand V. Avati
parent 29f81133a6
commit bb8ea22c3c

View File

@ -1185,7 +1185,14 @@ fuse_setattr (xlator_t *this, fuse_in_header_t *finh, void *msg)
attr.st_uid = fsi->uid;
attr.st_gid = fsi->gid;
if (state->fd) {
if (state->fd &&
!((fsi->valid & FATTR_ATIME) || (fsi->valid & FATTR_MTIME))) {
/*
there is no "futimes" call, so don't send
fsetattr if ATIME or MTIME is set
*/
FUSE_FOP (state, fuse_setattr_cbk, GF_FOP_FSETATTR,
fsetattr, state->fd, &attr,
fattr_to_gf_set_attr (fsi->valid));