Skip to content

Commit fe8d111

Browse files
bcodding-rhroxanan1996
authored andcommitted
NFS: Read unlock folio on nfs_page_create_from_folio() error
BugLink: https://bugs.launchpad.net/bugs/2060531 [ 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@redhat.com> Cc: <stable@vger.kernel.org> # 6.4+ Fixes: 000dbe0 ("NFS: Convert buffered read paths to use netfs when fscache is enabled") Signed-off-by: Benjamin Coddington <bcodding@redhat.com> Acked-by: Dave Wysochanski <dwysocha@redhat.com> Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com> Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
1 parent 572976b commit fe8d111

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

fs/nfs/read.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,8 @@ int nfs_read_add_folio(struct nfs_pageio_descriptor *pgio,
305305
new = nfs_page_create_from_folio(ctx, folio, 0, aligned_len);
306306
if (IS_ERR(new)) {
307307
error = PTR_ERR(new);
308+
if (nfs_netfs_folio_unlock(folio))
309+
folio_unlock(folio);
308310
goto out;
309311
}
310312

0 commit comments

Comments
 (0)