linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [BUG] fs: super: possible ABBA deadlocks in do_thaw_all_callback() and freeze_bdev()
@ 2021-12-27  2:03 Jia-Ju Bai
  2021-12-27  2:08 ` Matthew Wilcox
  0 siblings, 1 reply; 6+ messages in thread
From: Jia-Ju Bai @ 2021-12-27  2:03 UTC (permalink / raw)
  To: viro, Jens Axboe, hch; +Cc: linux-fsdevel, linux-block, linux-kernel

Hello,

My static analysis tool reports several possible ABBA deadlocks in Linux 
5.10:

do_thaw_all_callback()
   down_write(&sb->s_umount); --> Line 1028 (Lock A)
   emergency_thaw_bdev()
     thaw_bdev()
       mutex_lock(&bdev->bd_fsfreeze_mutex); --> Line 602 (Lock B)

freeze_bdev()
   mutex_lock(&bdev->bd_fsfreeze_mutex); --> Line 556 (Lock B)
   freeze_super()
     down_write(&sb->s_umount); --> Line 1716 (Lock A)
     down_write(&sb->s_umount); --> Line 1738 (Lock A)
   deactivate_super()
     down_write(&s->s_umount); --> Line 365 (Lock A)

When do_thaw_all_callback() and freeze_bdev() are concurrently executed, 
the deadlocks can occur.

I am not quite sure whether these possible deadlocks are real and how to 
fix them if them are real.
Any feedback would be appreciated, thanks :)

Reported-by: TOTE Robot <oslab@tsinghua.edu.cn>


Best wishes,
Jia-Ju Bai

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-12-28  2:31 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-12-27  2:03 [BUG] fs: super: possible ABBA deadlocks in do_thaw_all_callback() and freeze_bdev() Jia-Ju Bai
2021-12-27  2:08 ` Matthew Wilcox
2021-12-27  4:39   ` Theodore Ts'o
2021-12-27  9:32     ` Jia-Ju Bai
2021-12-27 13:43       ` Theodore Ts'o
2021-12-28  2:31         ` Jia-Ju Bai

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).