mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-05 19:31:57 -04:00
UPSTREAM: fuse: fix attr version comparison in fuse_read_update_size()
commit 484ce65715b06aead8c4901f01ca32c5a240bc71 upstream. 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. Change-Id: I03143ae182ed264aea806a02c5ff4edf0ae28239 Signed-off-by: Miklos Szeredi <mszeredi@redhat.com> Signed-off-by: Yang Bo <yb203166@antfin.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
9085f3d5d5
commit
f6598346ec
1 changed files with 1 additions and 1 deletions
|
|
@ -836,7 +836,7 @@ static void fuse_read_update_size(struct inode *inode, loff_t size,
|
|||
struct fuse_inode *fi = get_fuse_inode(inode);
|
||||
|
||||
spin_lock(&fi->lock);
|
||||
if (attr_ver == fi->attr_version && size < inode->i_size &&
|
||||
if (attr_ver >= fi->attr_version && size < inode->i_size &&
|
||||
!test_bit(FUSE_I_SIZE_UNSTABLE, &fi->state)) {
|
||||
fi->attr_version = atomic64_inc_return(&fc->attr_version);
|
||||
i_size_write(inode, size);
|
||||
|
|
|
|||
Loading…
Reference in a new issue