FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Cluster Development

 
 
LinkBack Thread Tools
 
Old 03-14-2011, 01:07 PM
Steven Whitehouse
 
Default GFS2: Adding missing unlock_page()

Hi,

This has been sent to me via bugzilla, but it needs to go upstream
first, so here is the upstream patch. I've given it a quick test
and it all seems correct,

Steve.

>From 6c474f7bc1ef70bc05ce486e7e7e524124122de8 Mon Sep 17 00:00:00 2001
From: Maxim <maxim.patlasov@gmail.com>
Date: Mon, 14 Mar 2011 13:19:21 +0000
Subject: [PATCH] GFS2: Adding missing unlock_page()

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@gmail.com>
Signed-off-by: Maxim <maxim.patlasov@gmail.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>

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
 
Old 03-15-2011, 08:11 AM
Steven Whitehouse
 
Default GFS2: Adding missing unlock_page()

From: Maxim <maxim.patlasov@gmail.com>

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@gmail.com>
Signed-off-by: Maxim <maxim.patlasov@gmail.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>

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
 

Thread Tools




All times are GMT. The time now is 09:29 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org