Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 321680
b: refs/heads/master
c: a889427
h: refs/heads/master
v: v3
  • Loading branch information
Brian Foster authored and Miklos Szeredi committed Jul 18, 2012
1 parent d797f11 commit 31b805c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: eed2179efe1aac145bf6d54b925b750976380fa6
refs/heads/master: a8894274a3581125fb311eabfc97cd0123740c5e
13 changes: 8 additions & 5 deletions trunk/fs/fuse/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -703,13 +703,16 @@ static ssize_t fuse_file_aio_read(struct kiocb *iocb, const struct iovec *iov,
unsigned long nr_segs, loff_t pos)
{
struct inode *inode = iocb->ki_filp->f_mapping->host;
struct fuse_conn *fc = get_fuse_conn(inode);

if (pos + iov_length(iov, nr_segs) > i_size_read(inode)) {
/*
* In auto invalidate mode, always update attributes on read.
* Otherwise, only update if we attempt to read past EOF (to ensure
* i_size is up to date).
*/
if (fc->auto_inval_data ||
(pos + iov_length(iov, nr_segs) > i_size_read(inode))) {
int err;
/*
* If trying to read past EOF, make sure the i_size
* attribute is up-to-date.
*/
err = fuse_update_attributes(inode, NULL, iocb->ki_filp, NULL);
if (err)
return err;
Expand Down

0 comments on commit 31b805c

Please sign in to comment.