Thread (4 messages) 4 messages, 2 authors, 2012-03-22

Re: [RFC PATCH 2/2] Btrfs: fix deadlock on umount by umount_prepare interface

From: Miao Xie <hidden>
Date: 2012-03-22 05:27:17
Also in: linux-fsdevel

On Thu, 22 Mar 2012 15:39:36 +1100, Dave Chinner wrote:
On Thu, Mar 22, 2012 at 11:13:17AM +0800, Miao Xie wrote:
quoted
The reason the deadlock is that:
  Task					Btrfs-cleaner
  umount()
    down_write(&s->s_umount)
    close_ctree()
      wait for the end of
      btrfs-cleaner
					start_transaction
					  reserve space
					    shrink_delalloc()
					      writeback_inodes_sb_nr_if_idle()
						down_read(&sb->s_umount)
So, the deadlock has happened.
Every time a deadlock involving writeback_inodes_sb...if_idle()
comes up, I give the same response. If the s_umount is write locked,
then the sb is not idle. IOWs, writeback_inodes_sb...if_idle()
should be doing down_read_trylock(), not down_read().
Someone did this work several months ago, but those patches have not been
applied until now, so...

https://lkml.org/lkml/2011/12/8/264

Thanks
Miao
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help