rpms/kernel/devel linux-2.6.27-xfs-barrier-fix.patch, NONE, 1.1 linux-2.6.27-xfs-remount-fix.patch, NONE, 1.1 TODO, 1.17, 1.18 kernel.spec, 1.1042, 1.1043 xfs-barrier-fix.patch, 1.2, NONE

Eric Sandeen sandeen at fedoraproject.org
Mon Oct 13 16:44:40 UTC 2008


Author: sandeen

Update of /cvs/pkgs/rpms/kernel/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv29086

Modified Files:
	TODO kernel.spec 
Added Files:
	linux-2.6.27-xfs-barrier-fix.patch 
	linux-2.6.27-xfs-remount-fix.patch 
Removed Files:
	xfs-barrier-fix.patch 
Log Message:
* Mon Oct 13 2008 Eric Sandeen <sandeen at redhat.com>
- Add fix for xfs root mount failure when some options are used.


linux-2.6.27-xfs-barrier-fix.patch:

--- NEW FILE linux-2.6.27-xfs-barrier-fix.patch ---
From: Christoph Hellwig <hch at lst.de>
Date: Fri, 10 Oct 2008 06:28:29 +0000 (+1100)
Subject: Fix barrier fail detection in XFS
X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=73f6aa4d44ab6157badc456ddfa05b31e58de5f0

Fix barrier fail detection in XFS

Currently we disable barriers as soon as we get a buffer in xlog_iodone
that has the XBF_ORDERED flag cleared.  But this can be the case not only
for buffers where the barrier failed, but also the first buffer of a
split log write in case of a log wraparound.  Due to the disabled
barriers we can easily get directory corruption on unclean shutdowns.
So instead of using this check add a new buffer flag for failed barrier
writes.

This is a regression vs 2.6.26 caused by patch to use the right macro
to check for the ORDERED flag, as we previously got true returned for
every buffer.

Thanks to Toei Rei for reporting the bug.

Signed-off-by: Christoph Hellwig <hch at lst.de>
Reviewed-by: Eric Sandeen <sandeen at sandeen.net>
Reviewed-by: David Chinner <david at fromorbit.com>
Signed-off-by: Tim Shimmin <tes at sgi.com>
Signed-off-by: Linus Torvalds <torvalds at linux-foundation.org>
---

diff --git a/fs/xfs/linux-2.6/xfs_buf.c b/fs/xfs/linux-2.6/xfs_buf.c
index 986061a..36d5fcd 100644
--- a/fs/xfs/linux-2.6/xfs_buf.c
+++ b/fs/xfs/linux-2.6/xfs_buf.c
@@ -1001,12 +1001,13 @@ xfs_buf_iodone_work(
 	 * We can get an EOPNOTSUPP to ordered writes.  Here we clear the
 	 * ordered flag and reissue them.  Because we can't tell the higher
 	 * layers directly that they should not issue ordered I/O anymore, they
-	 * need to check if the ordered flag was cleared during I/O completion.
+	 * need to check if the _XFS_BARRIER_FAILED flag was set during I/O completion.
 	 */
 	if ((bp->b_error == EOPNOTSUPP) &&
 	    (bp->b_flags & (XBF_ORDERED|XBF_ASYNC)) == (XBF_ORDERED|XBF_ASYNC)) {
 		XB_TRACE(bp, "ordered_retry", bp->b_iodone);
 		bp->b_flags &= ~XBF_ORDERED;
+		bp->b_flags |= _XFS_BARRIER_FAILED;
 		xfs_buf_iorequest(bp);
 	} else if (bp->b_iodone)
 		(*(bp->b_iodone))(bp);
diff --git a/fs/xfs/linux-2.6/xfs_buf.h b/fs/xfs/linux-2.6/xfs_buf.h
index fe01099..456519a 100644
--- a/fs/xfs/linux-2.6/xfs_buf.h
+++ b/fs/xfs/linux-2.6/xfs_buf.h
@@ -85,6 +85,14 @@ typedef enum {
 	 * modifications being lost.
 	 */
 	_XBF_PAGE_LOCKED = (1 << 22),
+
+	/*
+	 * If we try a barrier write, but it fails we have to communicate
+	 * this to the upper layers.  Unfortunately b_error gets overwritten
+	 * when the buffer is re-issued so we have to add another flag to
+	 * keep this information.
+	 */
+	_XFS_BARRIER_FAILED = (1 << 23),
 } xfs_buf_flags_t;
 
 typedef enum {
diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c
index 503ea89..0b02c64 100644
--- a/fs/xfs/xfs_log.c
+++ b/fs/xfs/xfs_log.c
@@ -1033,11 +1033,12 @@ xlog_iodone(xfs_buf_t *bp)
 	l = iclog->ic_log;
 
 	/*
-	 * If the ordered flag has been removed by a lower
-	 * layer, it means the underlyin device no longer supports
+	 * If the _XFS_BARRIER_FAILED flag was set by a lower
+	 * layer, it means the underlying device no longer supports
 	 * barrier I/O. Warn loudly and turn off barriers.
 	 */
-	if ((l->l_mp->m_flags & XFS_MOUNT_BARRIER) && !XFS_BUF_ISORDERED(bp)) {
+	if (bp->b_flags & _XFS_BARRIER_FAILED) {
+		bp->b_flags &= ~_XFS_BARRIER_FAILED;
 		l->l_mp->m_flags &= ~XFS_MOUNT_BARRIER;
 		xfs_fs_cmn_err(CE_WARN, l->l_mp,
 				"xlog_iodone: Barriers are no longer supported"


linux-2.6.27-xfs-remount-fix.patch:

--- NEW FILE linux-2.6.27-xfs-remount-fix.patch ---
>From the xfs list only, so far:

When we skip unrecognized options in xfs_fs_remount we should just break
out of the switch and not return because otherwise we may skip clearing
the xfs-internal read-only flag.  This will only show up on some
operations like touch because most read-only checks are done by the VFS
which things this filesystem is r/w.  Eventually we should replace the
XFS read-only flag with a helper that always checks the VFS flag to make
sure they can never get out of sync.

Bug reported and fix verified by Marcel Beister on #xfs.


Signed-off-by: Christoph Hellwig <hch at lst.de>

Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_super.c
===================================================================
--- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_super.c	2008-10-11 00:59:04.000000000 +0200
+++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_super.c	2008-10-11 00:59:35.000000000 +0200
@@ -1218,7 +1218,7 @@ xfs_fs_remount(
 	"XFS: mount option \"%s\" not supported for remount\n", p);
 			return -EINVAL;
 #else
-			return 0;
+			break;
 #endif
 		}
 	}





Index: TODO
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/TODO,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- TODO	10 Oct 2008 19:46:18 -0000	1.17
+++ TODO	13 Oct 2008 16:44:10 -0000	1.18
@@ -157,5 +157,7 @@
 linux-2.6-x86-improve-up-kernel-when-cpu-hotplug-and-smp.patch
 	scheduled for 2.6.28, should go in 2.6.27-stable after merging
 
-xfs-barrier-fix.patch
-	in 2.6.28-rc, should be sent for -stable
+linux-2.6.27-xfs-barrier-fix.patch
+linux-2.6.27-xfs-remount-fix.patch
+	Barrier fix in 2.6.28-rc, should be sent for -stable
+	Root remount problem fix only on the xfs list at this point


Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/kernel.spec,v
retrieving revision 1.1042
retrieving revision 1.1043
diff -u -r1.1042 -r1.1043
--- kernel.spec	10 Oct 2008 19:46:18 -0000	1.1042
+++ kernel.spec	13 Oct 2008 16:44:10 -0000	1.1043
@@ -686,8 +686,9 @@
 Patch2900: percpu_counter_sum_cleanup.patch
 Patch2901: ext4-patch-queue.patch
 
-# Fix for xfs wrongly disabling barriers
-Patch2902: xfs-barrier-fix.patch
+# Fix for xfs wrongly disabling barriers and remount problems
+Patch2902: linux-2.6.27-xfs-barrier-fix.patch
+Patch2903: linux-2.6.27-xfs-remount-fix.patch
 
 %endif
 
@@ -1094,7 +1095,8 @@
 # Pending ext4 patch queue, minus fiemap, includes s/ext4dev/ext4
 ApplyPatch ext4-patch-queue.patch
 # xfs
-ApplyPatch xfs-barrier-fix.patch
+ApplyPatch linux-2.6.27-xfs-barrier-fix.patch
+ApplyPatch linux-2.6.27-xfs-remount-fix.patch
 
 # USB
 ApplyPatch linux-2.6-usb-ehci-hcd-respect-nousb.patch
@@ -1812,6 +1814,9 @@
 %kernel_variant_files -k vmlinux %{with_kdump} kdump
 
 %changelog
+* Mon Oct 13 2008 Eric Sandeen <sandeen at redhat.com>
+- Add fix for xfs root mount failure when some options are used.
+
 * Fri Oct 10 2008 Dave Airlie <airlied at redhat.com>
 - rebase drm patches onto drm-next.patch which is going upstream
 - intel modesetting make not work properly due to rebase


--- xfs-barrier-fix.patch DELETED ---




More information about the scm-commits mailing list