[PATCH] coredump: Avoid fs freezing deadlock when dumping core

From: Jan Kara
Date: Fri Nov 22 2013 - 15:59:24 EST


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 <jack@xxxxxxx>
---
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


--liOOAslEiF7prFVr--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/