LKML Archive on
help / color / mirror / Atom feed
From: Sahitya Tummala <>
To: Jaegeuk Kim <>, Chao Yu <>,
Cc:, Sahitya Tummala <>
Subject: [PATCH v2] f2fs: Fix deadlock in shutdown ioctl
Date: Thu, 17 May 2018 13:33:31 +0530	[thread overview]
Message-ID: <> (raw)

f2fs_ioc_shutdown() ioctl gets stuck in the below path
when issued with F2FS_GOING_DOWN_FULLSYNC option.


Signed-off-by: Sahitya Tummala <>
remove lock coverage for only F2FS_GOING_DOWN_FULLSYNC case as suggested by Chao.

 fs/f2fs/file.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
index 6b94f19..5a132c9 100644
--- a/fs/f2fs/file.c
+++ b/fs/f2fs/file.c
@@ -1857,6 +1857,7 @@ static int f2fs_ioc_shutdown(struct file *filp, unsigned long arg)
 	switch (in) {
+		mnt_drop_write_file(filp);
 		sb = freeze_bdev(sb->s_bdev);
 		if (IS_ERR(sb)) {
 			ret = PTR_ERR(sb);
@@ -1894,7 +1895,8 @@ static int f2fs_ioc_shutdown(struct file *filp, unsigned long arg)
 	f2fs_update_time(sbi, REQ_TIME);
-	mnt_drop_write_file(filp);
+		mnt_drop_write_file(filp);
 	return ret;
Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project.

             reply	other threads:[~2018-05-17  8:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-17  8:03 Sahitya Tummala [this message]
2018-05-17 11:12 ` Chao Yu
2018-05-18  1:08   ` Jaegeuk Kim
2018-05-18  7:39     ` Sahitya Tummala

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \
    --subject='Re: [PATCH v2] f2fs: Fix deadlock in shutdown ioctl' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).