Patch "fuse: update inode size after extending passthrough write" has been added to the 6.11-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    fuse: update inode size after extending passthrough write

to the 6.11-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     fuse-update-inode-size-after-extending-passthrough-w.patch
and it can be found in the queue-6.11 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 4634ed8d06715ad0db5ef2989fb09511d5fa93ae
Author: Amir Goldstein <amir73il@xxxxxxxxx>
Date:   Mon Oct 14 21:27:59 2024 +0200

    fuse: update inode size after extending passthrough write
    
    [ Upstream commit 20121d3f58f06e977ca43eb6efe1fb23b1d2f6d9 ]
    
    yangyun reported that libfuse test test_copy_file_range() copies zero
    bytes from a newly written file when fuse passthrough is enabled.
    
    The reason is that extending passthrough write is not updating the fuse
    inode size and when vfs_copy_file_range() observes a zero size inode,
    it returns without calling the filesystem copy_file_range() method.
    
    Fix this by adjusting the fuse inode size after an extending passthrough
    write.
    
    This does not provide cache coherency of fuse inode attributes and
    backing inode attributes, but it should prevent situations where fuse
    inode size is too small, causing read/copy to be wrongly shortened.
    
    Reported-by: yangyun <yangyun50@xxxxxxxxxx>
    Closes: https://github.com/libfuse/libfuse/issues/1048
    Fixes: 57e1176e6086 ("fuse: implement read/write passthrough")
    Signed-off-by: Amir Goldstein <amir73il@xxxxxxxxx>
    Signed-off-by: Miklos Szeredi <mszeredi@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/fs/fuse/passthrough.c b/fs/fuse/passthrough.c
index f0f87d1c9a945..d1b570d39501c 100644
--- a/fs/fuse/passthrough.c
+++ b/fs/fuse/passthrough.c
@@ -22,7 +22,7 @@ static void fuse_passthrough_end_write(struct file *file, loff_t pos, ssize_t re
 {
 	struct inode *inode = file_inode(file);
 
-	fuse_invalidate_attr_mask(inode, FUSE_STATX_MODSIZE);
+	fuse_write_update_attr(inode, pos, ret);
 }
 
 ssize_t fuse_passthrough_read_iter(struct kiocb *iocb, struct iov_iter *iter)




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux