>From b7d1b0a12722eb6a5cb25cc614fae26ddf652c02 Mon Sep 17 00:00:00 2001 From: Jan Kara Date: Fri, 22 Nov 2013 21:59:24 +0100 Subject: [PATCH] coredump: Avoid fs freezing deadlock when dumping core Commit 2507a4fbd48a96bc4236e584252635f8539079df (make dump_emit() use vfs_write() instead of banging at ->f_op->write directly) introduced a possible deadlock when dumping core while filesystem is being frozen. We already acquired freeze protection in do_coredump() and after this patch we also acquire it in vfs_write(). Fix the problem by removing now unnecessary protection in do_coredump(). Fixes: 2507a4fbd48a96bc4236e584252635f8539079df Signed-off-by: Jan Kara --- fs/coredump.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/fs/coredump.c b/fs/coredump.c index 62406b6959b6..bdb9052744d8 100644 --- a/fs/coredump.c +++ b/fs/coredump.c @@ -657,11 +657,8 @@ void do_coredump(const siginfo_t *siginfo) goto close_fail; if (displaced) put_files_struct(displaced); - if (!dump_interrupted()) { - file_start_write(cprm.file); + if (!dump_interrupted()) core_dumped = binfmt->core_dump(&cprm); - file_end_write(cprm.file); - } if (ispipe && core_pipe_limit) wait_for_dump_helpers(cprm.file); close_fail: -- 1.8.1.4