Patch "NFS: Read unlock folio on nfs_page_create_from_folio() error" has been added to the 6.6-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

    NFS: Read unlock folio on nfs_page_create_from_folio() error

to the 6.6-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:
     nfs-read-unlock-folio-on-nfs_page_create_from_folio-.patch
and it can be found in the queue-6.6 subdirectory.

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



commit c781149a0c42881be1cbbbeea250763ffc599b13
Author: Benjamin Coddington <bcodding@xxxxxxxxxx>
Date:   Thu Mar 7 09:41:18 2024 -0500

    NFS: Read unlock folio on nfs_page_create_from_folio() error
    
    [ Upstream commit 11974eec839c167362af685aae5f5e1baaf979eb ]
    
    The netfs conversion lost a folio_unlock() for the case where
    nfs_page_create_from_folio() returns an error (usually -ENOMEM).  Restore
    it.
    
    Reported-by: David Jeffery <djeffery@xxxxxxxxxx>
    Cc: <stable@xxxxxxxxxxxxxxx> # 6.4+
    Fixes: 000dbe0bec05 ("NFS: Convert buffered read paths to use netfs when fscache is enabled")
    Signed-off-by: Benjamin Coddington <bcodding@xxxxxxxxxx>
    Acked-by: Dave Wysochanski <dwysocha@xxxxxxxxxx>
    Signed-off-by: Trond Myklebust <trond.myklebust@xxxxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/fs/nfs/read.c b/fs/nfs/read.c
index 7dc21a48e3e7b..a142287d86f68 100644
--- a/fs/nfs/read.c
+++ b/fs/nfs/read.c
@@ -305,6 +305,8 @@ int nfs_read_add_folio(struct nfs_pageio_descriptor *pgio,
 	new = nfs_page_create_from_folio(ctx, folio, 0, aligned_len);
 	if (IS_ERR(new)) {
 		error = PTR_ERR(new);
+		if (nfs_netfs_folio_unlock(folio))
+			folio_unlock(folio);
 		goto out;
 	}
 




[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