rpms/kernel/FC-6 linux-2.6-jbd-1k-crash-fix.patch, NONE, 1.1 kernel-2.6.spec, 1.2795, 1.2796

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Mon Oct 16 18:07:54 UTC 2006


Author: davej

Update of /cvs/dist/rpms/kernel/FC-6
In directory cvs.devel.redhat.com:/tmp/cvs-serv3217

Modified Files:
	kernel-2.6.spec 
Added Files:
	linux-2.6-jbd-1k-crash-fix.patch 
Log Message:
Fix JBD crash with 1K blocksize filesystems. (#209005)

linux-2.6-jbd-1k-crash-fix.patch:
 transaction.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+)

--- NEW FILE linux-2.6-jbd-1k-crash-fix.patch ---
>From davej  Thu Oct 12 15:47:28 2006
Return-Path: <esandeen at redhat.com>
X-Spam-Checker-Version: SpamAssassin 3.1.4 (2006-07-25) on 
	pressure.kernelslacker.org
X-Spam-Level: 
X-Spam-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,
	UNPARSEABLE_RELAY autolearn=ham version=3.1.4
Received: from pobox.devel.redhat.com [10.11.255.8]
	by pressure.kernelslacker.org with IMAP (fetchmail-6.3.4)
	for <davej at localhost> (single-drop); Thu, 12 Oct 2006 15:47:28 -0400 (EDT)
Received: from pobox.devel.redhat.com ([unix socket])
	 by pobox.devel.redhat.com (Cyrus v2.2.12-Invoca-RPM-2.2.12-3.RHEL4.1) with LMTPA;
	 Thu, 12 Oct 2006 15:47:10 -0400
X-Sieve: CMU Sieve 2.2
Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254])
	by pobox.devel.redhat.com (8.13.1/8.13.1) with ESMTP id k9CJlAvp014015
	for <davej at pobox.devel.redhat.com>; Thu, 12 Oct 2006 15:47:10 -0400
Received: from neon.msp.redhat.com (neon.msp.redhat.com [10.15.80.10])
	by int-mx1.corp.redhat.com (8.12.11.20060308/8.12.11) with ESMTP id k9CJl9uZ006786
	for <davej at redhat.com>; Thu, 12 Oct 2006 15:47:09 -0400
Received: from neon.msp.redhat.com (localhost.localdomain [127.0.0.1])
	by neon.msp.redhat.com (8.13.7/8.13.7) with ESMTP id k9CJl8Dl021891
	for <davej at redhat.com>; Thu, 12 Oct 2006 14:47:09 -0500
Received: (from esandeen at localhost)
	by neon.msp.redhat.com (8.13.7/8.13.7/Submit) id k9CJl85c021890
	for davej at redhat.com; Thu, 12 Oct 2006 14:47:08 -0500
Date: Thu, 12 Oct 2006 14:47:08 -0500
From: Eric Sandeen <esandeen at redhat.com>
Message-Id: <200610121947.k9CJl85c021890 at neon.msp.redhat.com>
To: davej at redhat.com
Subject: jbd patch
Status: RO
Content-Length: 1997
Lines: 55

Index: linux-2.6.18-1.2737.fc6/fs/jbd/transaction.c
===================================================================
--- linux-2.6.18-1.2737.fc6.orig/fs/jbd/transaction.c
+++ linux-2.6.18-1.2737.fc6/fs/jbd/transaction.c
@@ -967,6 +967,14 @@ int journal_dirty_data(handle_t *handle,
 	 */
 	jbd_lock_bh_state(bh);
 	spin_lock(&journal->j_list_lock);
+
+	/* Now that we have bh_state locked, are we really still mapped? */
+	if (!buffer_mapped(bh)) {
+		JBUFFER_TRACE(jh, "unmapped, bailing out");
+		// printk("caught an unmapped buffer\n");
+		goto no_journal;
+	}
+		
 	if (jh->b_transaction) {
 		JBUFFER_TRACE(jh, "has transaction");
 		if (jh->b_transaction != handle->h_transaction) {
@@ -1028,6 +1036,11 @@ int journal_dirty_data(handle_t *handle,
 				sync_dirty_buffer(bh);
 				jbd_lock_bh_state(bh);
 				spin_lock(&journal->j_list_lock);
+				/* Since we dropped the lock... */
+				if (!buffer_mapped(bh)) {
+					JBUFFER_TRACE(jh, "Got unmapped");
+					goto no_journal;
+				}
 				/* The buffer may become locked again at any
 				   time if it is redirtied */
 			}
@@ -1761,6 +1774,7 @@ static int journal_unmap_buffer(journal_
 	int ret;
 
 	BUFFER_TRACE(bh, "entry");
+	//J_ASSERT_BH(bh, PageLocked(bh->b_page));
 
 	/*
 	 * It is safe to proceed here without the j_list_lock because the
@@ -1834,6 +1848,7 @@ static int journal_unmap_buffer(journal_
 		}
 	} else if (transaction == journal->j_committing_transaction) {
 		if (jh->b_jlist == BJ_Locked) {
+			JBUFFER_TRACE(jh, "on committing BJ_Locked");
 			/*
 			 * The buffer is on the committing transaction's locked
 			 * list.  We have the buffer locked, so I/O has
@@ -1867,6 +1882,7 @@ static int journal_unmap_buffer(journal_
 		 * i_size already for this truncate so recovery will not
 		 * expose the disk blocks we are discarding here.) */
 		J_ASSERT_JH(jh, transaction == journal->j_running_transaction);
+		JBUFFER_TRACE(jh, "on running transaction");
 		may_free = __dispose_buffer(jh, transaction);
 	}
 



Index: kernel-2.6.spec
===================================================================
RCS file: /cvs/dist/rpms/kernel/FC-6/kernel-2.6.spec,v
retrieving revision 1.2795
retrieving revision 1.2796
diff -u -r1.2795 -r1.2796
--- kernel-2.6.spec	16 Oct 2006 17:54:33 -0000	1.2795
+++ kernel-2.6.spec	16 Oct 2006 18:07:52 -0000	1.2796
@@ -464,6 +464,7 @@
 
 # EXT3/JBD fixes
 Patch1450: linux-2.6-ext3-16tb-overflow-fixes.patch
+Patch1451: linux-2.6-jbd-1k-crash-fix.patch
 
 # Device mapper / MD layer
 Patch1500: linux-2.6-dm-mirroring.patch
@@ -1059,6 +1060,8 @@
 # EXT3
 # overflows at 16tb fix
 %patch1450 -p1
+# JBD crash with 1KB blocksize filesystems.
+%patch1451 -p1
 
 # Device mapper / MD layer
 # dm mirroring
@@ -2015,6 +2018,7 @@
 * Mon Oct 16 2006 Dave Jones <davej at redhat.com> 
 - Silence another noisy boot-time printk. (#210810)
 - Remove broken VIA quirk that prevented booting on some EPIAs (#210817)
+- Fix JBD crash with 1K blocksize filesystems. (#209005)
 
 * Mon Oct 16 2006 Stephen C. Tweedie <sct at redhat.com>
 - Add RPM release number to the Xen build version




More information about the fedora-cvs-commits mailing list