diff options
author | Maxim Patlasov <MPatlasov@parallels.com> | 2014-04-28 08:19:22 -0400 |
---|---|---|
committer | Miklos Szeredi <mszeredi@suse.cz> | 2014-04-28 08:19:22 -0400 |
commit | 009dd694e82098a703b8b5c8dd9f54c131dbb9b3 (patch) | |
tree | 1029035a0ee696e59cc0fd90d116d9c4f7be2d17 /fs/fuse | |
parent | d31433c8b06d44e27f7637574137dc4b5e6fd1d1 (diff) |
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/fuse')
-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 5b4e035b364c..5e361b122526 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, | |||
1678 | if (is_truncate) { | 1678 | if (is_truncate) { |
1679 | fuse_set_nowrite(inode); | 1679 | fuse_set_nowrite(inode); |
1680 | set_bit(FUSE_I_SIZE_UNSTABLE, &fi->state); | 1680 | set_bit(FUSE_I_SIZE_UNSTABLE, &fi->state); |
1681 | if (trust_local_mtime && attr->ia_size != inode->i_size) | ||
1682 | attr->ia_valid |= ATTR_MTIME; | ||
1681 | } | 1683 | } |
1682 | 1684 | ||
1683 | memset(&inarg, 0, sizeof(inarg)); | 1685 | memset(&inarg, 0, sizeof(inarg)); |