fuse: update attributes on aio_read
authorBrian Foster <bfoster@redhat.com>
Mon, 16 Jul 2012 19:23:50 +0000 (15:23 -0400)
committerMiklos Szeredi <mszeredi@suse.cz>
Wed, 18 Jul 2012 14:09:40 +0000 (16:09 +0200)
commita8894274a3581125fb311eabfc97cd0123740c5e
tree5d229b3f11b1e9800b95f47bdd1570c2b40e7675
parenteed2179efe1aac145bf6d54b925b750976380fa6
fuse: update attributes on aio_read

A fuse-based network filesystem might allow for the inode
and/or file data to change unexpectedly. A local client
that opens and repeatedly reads a file might never pick
up on such changes and indefinitely return stale data.

Always invoke fuse_update_attributes() in the read path
to cause an attr revalidation when the attributes expire.
This leads to a page cache invalidation if necessary and
ensures fuse issues new read requests to the fuse client.

The original logic (reval only on reads beyond EOF) 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/file.c