Skip to content

Commit 484ce65

Browse files
author
Miklos Szeredi
committed
fuse: fix attr version comparison in fuse_read_update_size()
A READ request returning a short count is taken as indication of EOF, and the cached file size is modified accordingly. Fix the attribute version checking to allow for changes to fc->attr_version on other inodes. Signed-off-by: Miklos Szeredi <[email protected]>
1 parent d347739 commit 484ce65

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/fuse/file.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -787,7 +787,7 @@ static void fuse_read_update_size(struct inode *inode, loff_t size,
787787
struct fuse_inode *fi = get_fuse_inode(inode);
788788

789789
spin_lock(&fi->lock);
790-
if (attr_ver == fi->attr_version && size < inode->i_size &&
790+
if (attr_ver >= fi->attr_version && size < inode->i_size &&
791791
!test_bit(FUSE_I_SIZE_UNSTABLE, &fi->state)) {
792792
fi->attr_version = atomic64_inc_return(&fc->attr_version);
793793
i_size_write(inode, size);

0 commit comments

Comments
 (0)