Commit 11974eec authored by Benjamin Coddington's avatar Benjamin Coddington Committed by Trond Myklebust

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: default avatarDavid Jeffery <djeffery@redhat.com>
Cc: <stable@vger.kernel.org> # 6.4+
Fixes: 000dbe0b ("NFS: Convert buffered read paths to use netfs when fscache is enabled")
Signed-off-by: default avatarBenjamin Coddington <bcodding@redhat.com>
Acked-by: default avatarDave Wysochanski <dwysocha@redhat.com>
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@hammerspace.com>
parent cdbd321a
...@@ -305,6 +305,8 @@ int nfs_read_add_folio(struct nfs_pageio_descriptor *pgio, ...@@ -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); new = nfs_page_create_from_folio(ctx, folio, 0, aligned_len);
if (IS_ERR(new)) { if (IS_ERR(new)) {
error = PTR_ERR(new); error = PTR_ERR(new);
if (nfs_netfs_folio_unlock(folio))
folio_unlock(folio);
goto out; goto out;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment