NFS: Read unlock folio on nfs_page_create_from_folio() error
Subsystems (2)
PATCH 1/1 NFS: Read unlock folio on nfs_page_create_from_folio() error
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 <[email protected]>
Cc <[email protected]> # 6.4+
Fixes 000dbe0bec05 ("NFS: Convert buffered read paths to use netfs when fscache is enabled")
Signed-off-by Benjamin Coddington <[email protected]>
--- fs/nfs/read.c | 2 ++ 1 file changed, 2 insertions(+)
fs/nfs/read.c +2 -0
@@ -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; }
Signature · 1 line
2.43.0
Quoted 27 lines · Benjamin Coddington
The netfs conversion lost a
folio_unlock()for the case wherenfs_page_create_from_folio()returns an error (usually-ENOMEM). Restore it.Reported-by David Jeffery <[email protected]>Cc <[email protected]> # 6.4+Fixes 000dbe0bec05 ("NFS: Convert buffered read paths to use netfs when fscache is enabled")Signed-off-by Benjamin Coddington <[email protected]>--- fs/nfs/read.c | 2 ++ 1 file changed, 2 insertions(+)fs/nfs/read.c +2
-1@@ -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; } --
Quoted 2 lines
2.43.0
Acked-by Dave Wysochanski <[email protected]>
PATCH RESEND 1/1 NFS: Read unlock folio on nfs_page_create_from_folio() error
In reply to Benjamin CoddingtonThe 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 <[email protected]>
Cc <[email protected]> # 6.4+
Fixes 000dbe0bec05 ("NFS: Convert buffered read paths to use netfs when fscache is enabled")
Signed-off-by Benjamin Coddington <[email protected]>
---
Resending this as I messed up Trond's email address on the first try:
https://lore.kernel.org/linux-nfs/CALF+zOn50xfKDBxqG1JfWVcRa+PvMvMpcWYfJmt0FWoUe0mW5w@mail.gmail.com/T/#t
--- fs/nfs/read.c | 2 ++ 1 file changed, 2 insertions(+)
fs/nfs/read.c +2 -0
@@ -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; }
Signature · 1 line
2.43.0