fuse: invalidate inode mapping if mtime changes
authorBrian Foster <bfoster@redhat.com>
Mon, 16 Jul 2012 19:23:49 +0000 (15:23 -0400)
committerMiklos Szeredi <mszeredi@suse.cz>
Wed, 18 Jul 2012 14:09:40 +0000 (16:09 +0200)
commiteed2179efe1aac145bf6d54b925b750976380fa6
treeb266220b26632c699a858b66c3d7b9ebc5853289
parent72d0d248ca8232dbd30d35b42d0d86e39b3e322b
fuse: invalidate inode mapping if mtime changes

We currently invalidate the inode address space mapping
if the file size changes unexpectedly. In the case of a
fuse network filesystem, a portion of a file could be
overwritten remotely without changing the file size.
Compare the old mtime as well to detect this condition
and invalidate the mapping if the file has been updated.

The original logic (to ignore changes in mtime) is
preserved unless the client specifies FUSE_AUTO_INVAL_DATA
on init.

Signed-off-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
fs/fuse/inode.c