rpms/kernel/F-11 linux-2.6-btrfs-fix-umount-hang.patch, NONE, 1.1 kernel.spec, 1.1501, 1.1502

Josef Bacik josef at fedoraproject.org
Thu Apr 2 17:21:58 UTC 2009


Author: josef

Update of /cvs/pkgs/rpms/kernel/F-11
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv2769

Modified Files:
	kernel.spec 
Added Files:
	linux-2.6-btrfs-fix-umount-hang.patch 
Log Message:
add linux-2.6-btrfs-fix-umount-hang.patch to fix a possible hang on umount.


linux-2.6-btrfs-fix-umount-hang.patch:

--- NEW FILE linux-2.6-btrfs-fix-umount-hang.patch ---
Need to check kthread_should_stop after schedule_timeout() before calling schedule(). This causes threads to sleep with potentially no one to wake them up causing mount(2) to hang in btrfs_stop_workers waiting for threads to stop. Race, IMO, is more evident on UP than on SMP.

Signed-off-by: Amit Gud <gud at ksu.edu>

diff --git a/fs/btrfs/async-thread.c b/fs/btrfs/async-thread.c
index c84ca1f..4c1f3e5 100644
--- a/fs/btrfs/async-thread.c
+++ b/fs/btrfs/async-thread.c
@@ -195,6 +195,9 @@ again_locked:
 				if (!list_empty(&worker->pending))
 					continue;
 
+				if (kthread_should_stop())
+					return 0;
+
 				/* still no more work?, sleep for real */
 				spin_lock_irq(&worker->lock);
 				set_current_state(TASK_INTERRUPTIBLE);


Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/F-11/kernel.spec,v
retrieving revision 1.1501
retrieving revision 1.1502
diff -u -r1.1501 -r1.1502
--- kernel.spec	1 Apr 2009 18:29:49 -0000	1.1501
+++ kernel.spec	2 Apr 2009 17:21:28 -0000	1.1502
@@ -689,6 +689,7 @@
 # fs fixes
 Patch2920: linux-2.6-ext4-flush-on-close.patch
 Patch3000: linux-2.6-btrfs-experimental-branch.patch
+Patch3001: linux-2.6-btrfs-fix-umount-hang.patch
 Patch3010: linux-2.6-relatime-by-default.patch
 Patch3020: linux-2.6-fiemap-header-install.patch
 
@@ -1139,6 +1140,7 @@
 
 # btrfs
 ApplyPatch linux-2.6-btrfs-experimental-branch.patch
+ApplyPatch linux-2.6-btrfs-fix-umount-hang.patch
 
 # relatime
 ApplyPatch linux-2.6-relatime-by-default.patch
@@ -1876,6 +1878,9 @@
 # and build.
 
 %changelog
+* Thu Apr 02 2009 Josef Bacik <josef at toxicpanda.com>
+- linux-2.6-btrfs-fix-umount-hang.patch: fix hang on umount
+
 * Wed Apr 01 2009 Matthew Garrett <mjg at redhat.com>
 - linux-2.6-shut-up-efifb.patch: avoid efifb errors on unsupported hardware
 




More information about the scm-commits mailing list