diff options
author | Maxim Patlasov <MPatlasov@parallels.com> | 2014-04-28 14:19:22 +0200 |
---|---|---|
committer | Miklos Szeredi <mszeredi@suse.cz> | 2014-04-28 14:19:22 +0200 |
commit | 009dd694e82098a703b8b5c8dd9f54c131dbb9b3 (patch) | |
tree | 1029035a0ee696e59cc0fd90d116d9c4f7be2d17 /fs | |
parent | d31433c8b06d44e27f7637574137dc4b5e6fd1d1 (diff) | |
download | op-kernel-dev-009dd694e82098a703b8b5c8dd9f54c131dbb9b3.zip op-kernel-dev-009dd694e82098a703b8b5c8dd9f54c131dbb9b3.tar.gz |
fuse: update mtime on truncate(2)
Handling truncate(2), VFS doesn't set ATTR_MTIME bit in iattr structure;
only ATTR_SIZE bit is set. In-kernel fuse must handle the case by setting
mtime fields of struct fuse_setattr_in to "now" and set FATTR_MTIME bit
even though ATTR_MTIME was not set.
Signed-off-by: Maxim Patlasov <MPatlasov@parallels.com>
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/fuse/dir.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c index 5b4e035..5e361b1 100644 --- a/fs/fuse/dir.c +++ b/fs/fuse/dir.c @@ -1678,6 +1678,8 @@ int fuse_do_setattr(struct inode *inode, struct iattr *attr, if (is_truncate) { fuse_set_nowrite(inode); set_bit(FUSE_I_SIZE_UNSTABLE, &fi->state); + if (trust_local_mtime && attr->ia_size != inode->i_size) + attr->ia_valid |= ATTR_MTIME; } memset(&inarg, 0, sizeof(inarg)); |