Patch "gfs2: Fix gfs2_file_buffered_write endless loop workaround" has been added to the 5.15-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

    gfs2: Fix gfs2_file_buffered_write endless loop workaround

to the 5.15-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:
     gfs2-fix-gfs2_file_buffered_write-endless-loop-worka.patch
and it can be found in the queue-5.15 subdirectory.

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



commit 31d722b87ad7f966a92c11fac9f013b997031f82
Author: Andreas Gruenbacher <agruenba@xxxxxxxxxx>
Date:   Thu Mar 17 14:47:24 2022 +0100

    gfs2: Fix gfs2_file_buffered_write endless loop workaround
    
    [ Upstream commit 46f3e0421ccb5474b5c006b0089b9dfd42534bb6 ]
    
    Since commit 554c577cee95b, gfs2_file_buffered_write() can accidentally
    return a truncated iov_iter, which might confuse callers.  Fix that.
    
    Fixes: 554c577cee95b ("gfs2: Prevent endless loops in gfs2_file_buffered_write")
    Signed-off-by: Andreas Gruenbacher <agruenba@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/fs/gfs2/file.c b/fs/gfs2/file.c
index 60390f9dc31f..e93185d804e0 100644
--- a/fs/gfs2/file.c
+++ b/fs/gfs2/file.c
@@ -1086,6 +1086,7 @@ static ssize_t gfs2_file_buffered_write(struct kiocb *iocb,
 	gfs2_holder_uninit(gh);
 	if (statfs_gh)
 		kfree(statfs_gh);
+	from->count = orig_count - read;
 	return read ? read : ret;
 }
 



[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