Patch "gfs2: Fix duplicate should_fault_in_pages() call" has been added to the 6.4-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 duplicate should_fault_in_pages() call

to the 6.4-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-duplicate-should_fault_in_pages-call.patch
and it can be found in the queue-6.4 subdirectory.

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



commit fc167ad98760525dae44bf6913726c6916544f46
Author: Bob Peterson <rpeterso@xxxxxxxxxx>
Date:   Mon Jun 12 12:26:23 2023 -0500

    gfs2: Fix duplicate should_fault_in_pages() call
    
    [ Upstream commit c8ed1b35931245087968fd95b2ec3dfc50f77769 ]
    
    In gfs2_file_buffered_write(), we currently jump from the second call of
    function should_fault_in_pages() to above the first call, so
    should_fault_in_pages() is getting called twice in a row, causing it to
    accidentally fall back to single-page writes rather than trying the more
    efficient multi-page writes first.
    
    Fix that by moving the retry label to the correct place, behind the
    first call to should_fault_in_pages().
    
    Fixes: e1fa9ea85ce8 ("gfs2: Stop using glock holder auto-demotion for now")
    Signed-off-by: Bob Peterson <rpeterso@xxxxxxxxxx>
    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 cb62c8f07d1e7..21335d1b67bf2 100644
--- a/fs/gfs2/file.c
+++ b/fs/gfs2/file.c
@@ -1030,8 +1030,8 @@ static ssize_t gfs2_file_buffered_write(struct kiocb *iocb,
 	}
 
 	gfs2_holder_init(ip->i_gl, LM_ST_EXCLUSIVE, 0, gh);
-retry:
 	if (should_fault_in_pages(from, iocb, &prev_count, &window_size)) {
+retry:
 		window_size -= fault_in_iov_iter_readable(from, window_size);
 		if (!window_size) {
 			ret = -EFAULT;



[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