The readpage address space operation is passed a locked page and is
supposed to unlock the page, either synchronously or via I/O completion.
In particular, it must never return a locked page on error.

Reported-by: Matthew Wilcox <wi...@infradead.org>
Fixes: 01b7c7ae88a6 ("[GFS2] Revise readpage locking")
Cc: sta...@vger.kernel.org # v2.6.27+
Signed-off-by: Andreas Gruenbacher <agrue...@redhat.com>
---
 fs/gfs2/aops.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/fs/gfs2/aops.c b/fs/gfs2/aops.c
index 6ccd478c81ff..9b257d3132dc 100644
--- a/fs/gfs2/aops.c
+++ b/fs/gfs2/aops.c
@@ -532,8 +532,6 @@ static int gfs2_readpage(struct file *file, struct page 
*page)
        gfs2_glock_dq(&gh);
 out:
        gfs2_holder_uninit(&gh);
-       if (error && error != AOP_TRUNCATED_PAGE)
-               lock_page(page);
        return error;
 }
 
-- 
2.26.2

Reply via email to