[PATCH 14/15] GFS2: Adding missing unlock_page()

From: Steven Whitehouse
Date: Tue Mar 15 2011 - 05:34:52 EST


From: Maxim <maxim.patlasov@xxxxxxxxx>

gfs2_write_begin() calls grab_cache_page_write_begin() that returns *locked*
page. Correspondent error-handling path lacks for unlock_page() call:

> out:
> if (error == 0)
> return 0;
>
> page_cache_release(page);

The whole system hangs if gfs2_unstuff_dinode() called from gfs2_write_begin()
failed for some reason.

Reported-by: Maxim <maxim.patlasov@xxxxxxxxx>
Signed-off-by: Maxim <maxim.patlasov@xxxxxxxxx>
Signed-off-by: Steven Whitehouse <swhiteho@xxxxxxxxxx>

diff --git a/fs/gfs2/aops.c b/fs/gfs2/aops.c
index 4f36f88..aad77e4 100644
--- a/fs/gfs2/aops.c
+++ b/fs/gfs2/aops.c
@@ -695,6 +695,7 @@ out:
if (error == 0)
return 0;

+ unlock_page(page);
page_cache_release(page);

gfs2_trans_end(sdp);
--
1.7.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/