[Unionfs] 2.6.26-rc4: smack and unionfs deadlock

Luiz Fernando N. Capitulino lcapitulino at mandriva.com.br
Wed Jun 4 16:22:31 EDT 2008


 Hi Casey,

 I've got another deadlock which only happens when CONFIG_SMACK is
enabled, but this time it happens with unionfs and I don't know
which of the two is causing the problem.

 If you mount a unionfs stack and try a ls on it, ls will hang
and you'll get a deadlock.

 For example:

"""
# mount -t unionfs -odirs=x=rw:drakx=ro unionfs Pictures
# ls -la Pictures/
"""

 The directories names don't matter, but for what is worth,
x and drakx have some files and Picture is empty.

 To duplicate this problem you will need:

1. kernel version 2.6.26-rc4

2. Unionfs latest patch:

http://download.filesystems.org/unionfs/unionfs-2.x/unionfs-2.3.3_for_2.6.25.diff.gz

3. fs-unionfs-use-new-umount_begin-prototype.patch (attached)

4. Casey's fix for mount hang, otherwise you will get the mount
deadlock bug with unionfs (smack-fuse-mount-hang-fix.patch, attached)

 Then try to mount a unionfs stack, I'm pretty sure any populated
stack will cause the problem.

 By the way, I've also attached the lockdep warning for this
and the sysrq+w output.

 Please, let me know if you need any other information.

 Best regards.

-- 
Luiz Fernando N. Capitulino
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fs-unionfs-use-new-umount_begin-prototype.patch
Type: text/x-patch
Size: 1657 bytes
Desc: not available
Url : http://www.fsl.cs.sunysb.edu/pipermail/unionfs/attachments/20080604/c828d191/fs-unionfs-use-new-umount_begin-prototype.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smack-fuse-mount-hang-fix.patch
Type: text/x-patch
Size: 1405 bytes
Desc: not available
Url : http://www.fsl.cs.sunysb.edu/pipermail/unionfs/attachments/20080604/c828d191/smack-fuse-mount-hang-fix.bin
-------------- next part --------------
Registering unionfs 2.3.3 (for 2.6.25)

=============================================
[ INFO: possible recursive locking detected ]
2.6.26-0.rc4.601mdv #1
---------------------------------------------
ls/3930 is trying to acquire lock:
 (&UNIONFS_SB(sb)->rwsem/2){..--}, at: [<e0b76f49>] unionfs_getxattr+0x3a/0xb7 [unionfs]

but task is already holding lock:
 (&UNIONFS_SB(sb)->rwsem/2){..--}, at: [<e0b6ea11>] unionfs_lookup+0x37/0xfa [unionfs]

other info that might help us debug this:
5 locks held by ls/3930:
 #0:  (&sb->s_type->i_mutex_key#12){--..}, at: [<c0177423>] do_lookup+0x72/0x146
 #1:  (&UNIONFS_SB(sb)->rwsem/2){..--}, at: [<e0b6ea11>] unionfs_lookup+0x37/0xfa [unionfs]
 #2:  (&info->lock#2/1){--..}, at: [<e0b6ea2d>] unionfs_lookup+0x53/0xfa [unionfs]
 #3:  (&info->lock#3/3){--..}, at: [<e0b74344>] new_dentry_private_data+0x54/0xef [unionfs]
 #4:  (&isp->smk_lock){--..}, at: [<c01c7f74>] smack_d_instantiate+0x36/0x11c

stack backtrace:
Pid: 3930, comm: ls Not tainted 2.6.26-0.rc4.601mdv #1
 [<c0139270>] __lock_acquire+0x88a/0xb97
 [<c01395dc>] lock_acquire+0x5f/0x84
 [<e0b76f49>] ? unionfs_getxattr+0x3a/0xb7 [unionfs]
 [<c0130b5f>] down_read_nested+0x17/0x2a
 [<e0b76f49>] ? unionfs_getxattr+0x3a/0xb7 [unionfs]
 [<e0b76f49>] unionfs_getxattr+0x3a/0xb7 [unionfs]
 [<e0b76f0f>] ? unionfs_getxattr+0x0/0xb7 [unionfs]
 [<c01c8010>] smack_d_instantiate+0xd2/0x11c
 [<c01c4eee>] security_d_instantiate+0x1c/0x1e
 [<c0181113>] d_instantiate+0x57/0x5c
 [<c01811dd>] d_splice_alias+0xc5/0xd5
 [<e0b6f5bb>] unionfs_interpose+0x130/0x197 [unionfs]
 [<e0b74bfa>] unionfs_lookup_backend+0x731/0x955 [unionfs]
 [<e0b6ea52>] unionfs_lookup+0x78/0xfa [unionfs]
 [<c0177458>] do_lookup+0xa7/0x146
 [<c0179192>] __link_path_walk+0x8ad/0xd06
 [<c010a136>] ? save_stack_address+0x0/0x2c
 [<c010a136>] ? save_stack_address+0x0/0x2c
 [<c0179634>] path_walk+0x49/0x96
 [<c017998b>] do_path_lookup+0x18c/0x1d4
 [<c0178892>] ? getname+0x64/0xb7
 [<c017a2bd>] __user_walk_fd+0x2f/0x43
 [<c0173e7a>] vfs_lstat_fd+0x16/0x3d
 [<c02cd967>] ? __mutex_unlock_slowpath+0xe7/0xf8
 [<c0173f0c>] vfs_lstat+0x11/0x13
 [<c0173f22>] sys_lstat64+0x14/0x28
 [<c02cd980>] ? mutex_unlock+0x8/0xa
 [<c017bc4f>] ? vfs_readdir+0x83/0x94
 [<c017b9a4>] ? filldir64+0x0/0xcd
 [<c0103978>] ? sysenter_past_esp+0xc1/0xd9
 [<c01384c3>] ? trace_hardirqs_on+0xe7/0x108
 [<c0103978>] ? sysenter_past_esp+0xc1/0xd9
 [<c010392f>] sysenter_past_esp+0x78/0xd9
 =======================
-------------- next part --------------
SysRq : HELP : loglevel0-8 reBoot Crashdump show-all-locks(D) tErm Full kIll saK showMem Nice powerOff showPc show-all-timers(Q) unRaw Sync showTasks Unmount shoW-blocked-tasks 
SysRq : HELP : loglevel0-8 reBoot Crashdump show-all-locks(D) tErm Full kIll saK showMem Nice powerOff showPc show-all-timers(Q) unRaw Sync showTasks Unmount shoW-blocked-tasks 
SysRq : Show Blocked State
  task                PC stack   pid father
ls            D 00000046     0  3930   3862
       ddd19cb0 00000046 ddd5ea00 00000046 dd2005d0 ddd5ea00 ddd5ec5c bf920300 
       0000001c 00000002 00000001 e0b76f5b ddd19cc8 dd20059c ffffffff dd20059c 
       00000246 ddd19ce8 c02cd4d0 00000003 e0b76f5b ddd5ea00 dd2005bc dd2005bc 
Call Trace:
 [<e0b76f5b>] ? unionfs_getxattr+0x4c/0xb7 [unionfs]
 [<c02cd4d0>] mutex_lock_nested+0x140/0x238
 [<e0b76f5b>] ? unionfs_getxattr+0x4c/0xb7 [unionfs]
 [<e0b76f5b>] unionfs_getxattr+0x4c/0xb7 [unionfs]
 [<e0b76f0f>] ? unionfs_getxattr+0x0/0xb7 [unionfs]
 [<c01c8010>] smack_d_instantiate+0xd2/0x11c
 [<c01c4eee>] security_d_instantiate+0x1c/0x1e
 [<c0181113>] d_instantiate+0x57/0x5c
 [<c01811dd>] d_splice_alias+0xc5/0xd5
 [<e0b6f5bb>] unionfs_interpose+0x130/0x197 [unionfs]
 [<e0b74bfa>] unionfs_lookup_backend+0x731/0x955 [unionfs]
 [<e0b6ea52>] unionfs_lookup+0x78/0xfa [unionfs]
 [<c0177458>] do_lookup+0xa7/0x146
 [<c0179192>] __link_path_walk+0x8ad/0xd06
 [<c010a136>] ? save_stack_address+0x0/0x2c
 [<c010a136>] ? save_stack_address+0x0/0x2c
 [<c0179634>] path_walk+0x49/0x96
 [<c017998b>] do_path_lookup+0x18c/0x1d4
 [<c0178892>] ? getname+0x64/0xb7
 [<c017a2bd>] __user_walk_fd+0x2f/0x43
 [<c0173e7a>] vfs_lstat_fd+0x16/0x3d
 [<c02cd967>] ? __mutex_unlock_slowpath+0xe7/0xf8
 [<c0173f0c>] vfs_lstat+0x11/0x13
 [<c0173f22>] sys_lstat64+0x14/0x28
 [<c02cd980>] ? mutex_unlock+0x8/0xa
 [<c017bc4f>] ? vfs_readdir+0x83/0x94
 [<c017b9a4>] ? filldir64+0x0/0xcd
 [<c0103978>] ? sysenter_past_esp+0xc1/0xd9
 [<c01384c3>] ? trace_hardirqs_on+0xe7/0x108
 [<c0103978>] ? sysenter_past_esp+0xc1/0xd9
 [<c010392f>] sysenter_past_esp+0x78/0xd9
 =======================
Sched Debug Version: v0.07, 2.6.26-0.rc4.601mdv #1
now at 402669.857161 msecs
  .sysctl_sched_latency                    : 20.000000
  .sysctl_sched_min_granularity            : 4.000000
  .sysctl_sched_wakeup_granularity         : 10.000000
  .sysctl_sched_child_runs_first           : 0.000001
  .sysctl_sched_features                   : 895

cpu#0, 1102.574 MHz
  .nr_running                    : 3
  .load                          : 5169
  .nr_switches                   : 34794
  .nr_load_updates               : 13293
  .nr_uninterruptible            : 1
  .jiffies                       : 25201
  .next_balance                  : 0.000000
  .curr->pid                     : 0
  .clock                         : 400804.014200
  .cpu_load[0]                   : 0
  .cpu_load[1]                   : 0
  .cpu_load[2]                   : 3
  .cpu_load[3]                   : 42
  .cpu_load[4]                   : 87

cfs_rq[0]:
  .exec_clock                    : 60832.163292
  .MIN_vruntime                  : 117714.477293
  .min_vruntime                  : 117906.460520
  .max_vruntime                  : 117895.421323
  .spread                        : 180.944030
  .spread0                       : 0.000000
  .nr_running                    : 3
  .load                          : 5169
  .bkl_count                     : 0
  .nr_spread_over                : 7554

runnable tasks:
            task   PID         tree-key  switches  prio     exec-runtime         sum-exec        sum-sleep
----------------------------------------------------------------------------------------------------------
        events/0     5    117895.421323       399   115    117895.421323       795.120743    398937.563418
           klogd  2608    117714.477293       301   120    117714.477293        33.369112    356651.801015
 hald-addon-inpu  3668    117814.569036        52   120    117814.569036         9.122703    342441.540189



More information about the unionfs mailing list