Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > 27922b4260f65d317aabda37e42bbbff > files > 1333

kernel-2.6.18-238.el5.src.rpm

From: Bob Peterson <rpeterso@redhat.com>
Date: Mon, 21 Jan 2008 10:54:12 -0600
Subject: [gfs2] lock the page on error
Message-id: 1200934452.3640.97.camel@technetium.msp.redhat.com
O-Subject: [PATCH RHEL5.2] [GFS2] bz #429168: GFS2: Kernel BUG at mm/filemap.c:553
Bugzilla: 429168

Hi,

This patch fixes bug #429168.  When there is an error condition
(such as disk full) the GFS2 prepare_write code was sending back
the error code correctly, but forgot to re-lock the page.  The
page should be locked when returning errors to vfs unless it's
AOP_TRUNCATED_PAGE.

This fix was tested on system roth-01.

This fix did not go upstream (and doesn't need to) because the
upstream version of GFS2 has evolved to the point where this is
not needed.

Regards,

Bob Peterson
Red Hat GFS

Signed-off-by: Bob Peterson <rpeterso@redhat.com>
--

Acked-by: Steven Whitehouse <swhiteho@redhat.com>

diff --git a/fs/gfs2/ops_address.c b/fs/gfs2/ops_address.c
index 8cff6cf..22ac7ee 100644
--- a/fs/gfs2/ops_address.c
+++ b/fs/gfs2/ops_address.c
@@ -670,6 +670,7 @@ out_alloc_put:
 out_unlock:
 	gfs2_glock_dq(&ip->i_gh);
 out_uninit:
+	lock_page(page);
 	gfs2_holder_uninit(&ip->i_gh);
 	return ret;
 }