[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4BFE4203.5010803@kernel.org>
Date: Thu, 27 May 2010 11:57:23 +0200
From: Tejun Heo <tj@...nel.org>
To: David Howells <dhowells@...hat.com>
CC: davem@...emloft.net, jens.axboe@...cle.com,
linux-kernel@...r.kernel.org, torvalds@...l.org,
viro@...IV.linux.org.uk, akpm@...ux-foundation.org
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@...nel.org>
Reported-by: David Howells <dhowells@...hat.com>
Cc: Al Viro <viro@...IV.linux.org.uk>
Cc: Jens Axboe <jens.axboe@...cle.com>
Cc: Andrew Morton <akpm@...ux-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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists