Bug 202173

Summary: Btrfs deadlock calling leaf_space_used() and btrfs_tree_read_lock()
Product: File System Reporter: Eli V (eliventer)
Component: btrfsAssignee: BTRFS virtual assignee (fs_btrfs)
Status: RESOLVED CODE_FIX    
Severity: high CC: dsterba
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 4.19.12 Subsystem:
Regression: No Bisected commit-id:
Attachments: dmesg stack traces just before deadlock

Description Eli V 2019-01-07 19:13:32 UTC
Running an rsync process writing to the btrfs filesystem deadlocked with a bunch of kworkers in leaf_space_used and one in btrfs_tree_read_lock(). The first stack trace in the attched file, hitting btrfs_lock_root_node(), was about 2 minutes before the deadlock when all activity on the filesystem stopped.
Comment 1 Eli V 2019-01-07 19:14:19 UTC
Created attachment 280299 [details]
dmesg stack traces just before deadlock
Comment 2 David Sterba 2019-01-08 16:17:24 UTC
Thanks for the report. Fix https://patchwork.kernel.org/patch/10751909/ will go to 5.0-rc and then to stable 4.19.x.