From: bugzilla-daemon@bugzilla.kernel.org
To: linux-f2fs-devel@lists.sourceforge.net
Subject: [f2fs-dev] [Bug 208565] New: There may be dead lock for cp_rwsem during checkpoint
Date: Wed, 15 Jul 2020 12:24:37 +0000 [thread overview]
Message-ID: <bug-208565-202145@https.bugzilla.kernel.org/> (raw)
https://bugzilla.kernel.org/show_bug.cgi?id=208565
Bug ID: 208565
Summary: There may be dead lock for cp_rwsem during checkpoint
Product: File System
Version: 2.5
Kernel Version: 4.14.181
Hardware: All
OS: Linux
Tree: Mainline
Status: NEW
Severity: high
Priority: P1
Component: f2fs
Assignee: filesystem_f2fs@kernel-bugs.kernel.org
Reporter: Zhiguo.Niu@unisoc.com
Regression: No
A deadlock may happens in the following scenario, backtrace is:
PID: 257 TASK: ecdd0000 CPU: 0 COMMAND: "init"
#0 [<c0b420ec>] (__schedule) from [<c0b423c8>]
#1 [<c0b423c8>] (schedule) from [<c0b459d4>]
#2 [<c0b459d4>] (rwsem_down_read_failed) from [<c0b44fa0>]
#3 [<c0b44fa0>] (down_read) from [<c044233c>]
#4 [<c044233c>] (f2fs_truncate_blocks) from [<c0442890>]
#5 [<c0442890>] (f2fs_truncate) from [<c044d408>]
#6 [<c044d408>] (f2fs_evict_inode) from [<c030be18>]
#7 [<c030be18>] (evict) from [<c030a558>]
#8 [<c030a558>] (iput) from [<c047c600>]
#9 [<c047c600>] (f2fs_sync_node_pages) from [<c0465414>]
#10 [<c0465414>] (f2fs_write_checkpoint) from [<c04575f4>]
#11 [<c04575f4>] (f2fs_sync_fs) from [<c0441918>]
#12 [<c0441918>] (f2fs_do_sync_file) from [<c0441098>]
#13 [<c0441098>] (f2fs_sync_file) from [<c0323fa0>]
#14 [<c0323fa0>] (vfs_fsync_range) from [<c0324294>]
#15 [<c0324294>] (do_fsync) from [<c0324014>]
#16 [<c0324014>] (sys_fsync) from [<c0108bc0>]
f2fs_sync_node_pages tries to flush dirty inode and calls iput(). This results
in deadlock as iput() tries to hold cp_rwsem, which is already held at the
beginning by checkpoint->block_operations().
There is a similar issue and patch in android.googlesource.com with commit id
is 82cc5e607b56abea4ea77023650247f5ae41b515, but the call trace is:
- f2fs_sync_node_pages()
- if (is_inline_node(page))
> - flush_inline_data()
- ilookup()
page = f2fs_pagecache_get_page()
if (!page)
goto iput_out;
iput_out:
-close()
-iput()
iput(inode);
- f2fs_evict_inode()
- f2fs_truncate_blocks()
- f2fs_lock_op()
- down_read(&sbi->cp_rwsem);
it seems than this patch has not cover current deadlock scenario, the current
deadlock call trace is:
- f2fs_sync_node_pages()
> - if (flush_dirty_inode(page))
- iput(inode);
- f2fs_evict_inode()
- f2fs_truncate_blocks()
- f2fs_lock_op()
- down_read(&sbi->cp_rwsem);
please help check and confirm.
thanks!
--
You are receiving this mail because:
You are watching the assignee of the bug.
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
next reply other threads:[~2020-07-15 12:24 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-15 12:24 bugzilla-daemon [this message]
2020-07-16 17:15 ` [f2fs-dev] [Bug 208565] There may be dead lock for cp_rwsem during checkpoint bugzilla-daemon
2020-07-24 1:31 ` Chao Yu
2020-07-17 1:54 ` bugzilla-daemon
2020-07-17 2:02 ` bugzilla-daemon
2020-07-17 2:26 ` bugzilla-daemon
2020-07-17 6:16 ` [f2fs-dev] Fwd: " Chao Yu
2020-07-17 2:47 ` [f2fs-dev] " bugzilla-daemon
2020-07-23 7:11 ` bugzilla-daemon
2020-07-24 1:31 ` bugzilla-daemon
2020-07-24 3:21 ` bugzilla-daemon
2020-07-24 3:38 ` Chao Yu
2020-07-24 3:38 ` bugzilla-daemon
2020-07-24 3:56 ` bugzilla-daemon
2020-07-24 6:36 ` bugzilla-daemon
2020-07-24 17:25 ` bugzilla-daemon
2022-09-27 0:48 ` bugzilla-daemon
2022-09-27 0:49 ` bugzilla-daemon
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:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=bug-208565-202145@https.bugzilla.kernel.org/ \
--to=bugzilla-daemon@bugzilla.kernel.org \
--cc=linux-f2fs-devel@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.