linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [2.6.38] Possible deadlock at pivot_root?
@ 2011-03-16  8:54 Tetsuo Handa
  2011-03-17  5:01 ` [2.6.38] Deadlock between rename_lock and vfsmount_lock Tetsuo Handa
  0 siblings, 1 reply; 13+ messages in thread
From: Tetsuo Handa @ 2011-03-16  8:54 UTC (permalink / raw)
  To: linux-fsdevel

I got a freeze (without lockdep warning) with a small out-of-tree patch
applied on 2.6.38. It seems to me that the deadlock occurred when running
pivot_root(). I guess it is spinning at spin_lock() below.

Is below lock dependency safe?

d_path():

  write_seqlock(&rename_lock);
    br_read_lock(vfsmount_lock);
      spin_lock(&dentry->d_lock);

      spin_unlock(&dentry->d_lock);
    br_read_unlock(vfsmount_lock);
  write_sequnlock(&rename_lock);

pivot_root():

  down_write(&namespace_sem);
    mutex_lock(&old.dentry->d_inode->i_mutex);
      br_write_lock(vfsmount_lock);
        spin_lock(&dentry->d_lock);

        spin_unlock(&dentry->d_lock);
      br_write_unlock(vfsmount_lock);
    mutex_unlock(&old.dentry->d_inode->i_mutex);
  up_write(&namespace_sem);

[  384.711037] 8 locks held by make/6110:
[  384.711037]  #0:  (&ccs_ss){.+.+.+}, at: [<c11bc320>] ccs_path_perm+0x0/0x1c0
[  384.711037]  #1:  (rename_lock){+.+...}, at: [<c10e41c9>] __d_path+0x39/0x80
[  384.711037]  #2:  (vfsmount_lock){++++..}, at: [<c10e8500>] vfsmount_lock_local_lock+0x0/0x60
[  384.711037]  #3:  (&serio->lock){-.-...}, at: [<c12ddb68>] serio_interrupt+0x28/0x80
[  384.711037]  #4:  (&(&dev->event_lock)->rlock){-.-...}, at: [<c12e053f>] input_event+0x3f/0x70
[  384.711037]  #5:  (rcu_read_lock){.+.+..}, at: [<c12dfe30>] input_pass_event+0x0/0x1c0
[  384.711037]  #6:  (sysrq_key_table_lock){-.-...}, at: [<c124c348>] __handle_sysrq+0x18/0x110
[  384.711037]  #7:  (tasklist_lock){.?.?..}, at: [<c10701a6>] debug_show_all_locks+0x36/0x1d0
[  384.711037] 

(I think #3 to #7 are caused by pressing sysrq key.)
Complete log is at http://I-love.SAKURA.ne.jp/tmp/dmesg-2.6.38.txt

Regards.

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

end of thread, other threads:[~2011-03-24  0:10 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-16  8:54 [2.6.38] Possible deadlock at pivot_root? Tetsuo Handa
2011-03-17  5:01 ` [2.6.38] Deadlock between rename_lock and vfsmount_lock Tetsuo Handa
2011-03-18 10:59   ` Tetsuo Handa
2011-03-18 11:06     ` Al Viro
2011-03-18 11:54       ` Tetsuo Handa
2011-03-18 12:07       ` Al Viro
2011-03-18 12:13         ` Al Viro
2011-03-18 12:52         ` Al Viro
2011-03-18 13:18           ` Al Viro
2011-03-19  2:39             ` Tetsuo Handa
2011-03-23 23:00               ` Greg KH
2011-03-24  0:04                 ` Tetsuo Handa
2011-03-24  0:10                   ` Greg KH

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