lkml.org 
[lkml]   [2010]   [May]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] fs: run emergency remount on dedicated workqueue
Commit fa4b9074cd8428958c2adf9dc0c831f46e27c193 made s_umount depend
on keventd; however, emergency remount schedules works to keventd
which grabs s_umount creating a circular dependency. Run emergency
remount on a separate workqueue to break it.

Signed-off-by: Tejun Heo <tj@kernel.org>
Reported-by: David Howells <dhowells@redhat.com>
Cc: Al Viro <viro@ZenIV.linux.org.uk>
Cc: Jens Axboe <jens.axboe@oracle.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
---
Unless someone objects, Andrew, can you please take this patch?

Thanks.

fs/super.c | 19 ++++++++++++++++++-
1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/fs/super.c b/fs/super.c
index 69688b1..1ada607 100644
--- a/fs/super.c
+++ b/fs/super.c
@@ -575,6 +575,11 @@ int do_remount_sb(struct super_block *sb, int flags, void *data, int force)
return 0;
}

+/*
+ * For emergency remount
+ */
+static struct workqueue_struct *emergency_remount_wq;
+
static void do_emergency_remount(struct work_struct *work)
{
struct super_block *sb, *n;
@@ -605,13 +610,25 @@ void emergency_remount(void)
{
struct work_struct *work;

+ if (!emergency_remount_wq)
+ return;
+
work = kmalloc(sizeof(*work), GFP_ATOMIC);
if (work) {
INIT_WORK(work, do_emergency_remount);
- schedule_work(work);
+ queue_work(emergency_remount_wq, work);
}
}

+static int __init emergency_remount_init(void)
+{
+ emergency_remount_wq = create_singlethread_workqueue("emerg-remount");
+ if (!emergency_remount_wq)
+ pr_warn("failed to create emergency remount workqueue\n");
+ return 0;
+}
+subsys_initcall(emergency_remount_init);
+
/*
* Unnamed block devices are dummy devices used by virtual
* filesystems which don't use real block-devices. -- jrs

\
 
 \ /
  Last update: 2010-05-27 12:01    [W:0.073 / U:1.120 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site