mdev + usb pen drive + umount problem

Dieter Kiermaier dk-arm-linux at gmx.de
Fri Nov 6 14:05:18 UTC 2009


Hi all,

I'm new to this list and have a few questions with regards to busybox mount / umount and mdev.

I'm using:
sh-3.2# busybox
BusyBox v1.15.2 (2009-10-23 11:20:45 CEST) multi-call binary
Copyright (C) 1998-2008 Erik Andersen, Rob Landley, Denys Vlasenko
and others. Licensed under GPLv2.
See source distribution for full notice.

on a ARM platform and have some problems with unmounting usb pendrives by mdev.

My entry in mdev.conf looks like:
sd[a-z][0-9]* 0:0 660 * /sbin/mdev_mount_usbdisk.sh

and my script is triggered very well.

mdev_mount_usbdisk.sh:

output=/dev/ttyS0
mountpoint=/mnt/usbdisk

#for debugging enable env output to see what mdev sends to the script
#env > $output
#prevent script from running on /dev/sd[a-z]

#important:
#vfat doesn't differentiate upper lower case file names,
#so -o shortname=mixed is required to prevent linux from
#reading different filenames than specified in the playlist
if [ $MINOR != "0" ]

then
    echo "MINOR = $MINOR" > $output
    case $ACTION in
            add)
            echo "mounting usbdisk to $mountpoint" > $output
            mount /dev/$DEVNAME $mountpoint -o shortname=mixed
            ;;
            remove)
            echo "unmounting usbdisk from $mountpoint" > $output
            umount -f -l /dev/$DEVNAME
            ;;
    esac
    echo "done" > $output
fi


The problem is, that the umount call in remove doesn't return succesfully.
It is scheduled in the background and never finishes.

After a while i can see:

sh-3.2# INFO: task umount:574 blocked for more than 120 seconds.
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
umount        D c03467c0     0   574    567 0x00000000
[<c03467c0>] (schedule+0x360/0x3f0) from [<c00d18f0>] (bdi_sched_wait+0xc/0x18)
[<c00d18f0>] (bdi_sched_wait+0xc/0x18) from [<c03472e4>] (__wait_on_bit+0x60/0xac)
[<c03472e4>] (__wait_on_bit+0x60/0xac) from [<c03473a4>] (out_of_line_wait_on_bit+0x74/0x80)
[<c03473a4>] (out_of_line_wait_on_bit+0x74/0x80) from [<c00d1984>] (sync_inodes_sb+0x88/0x17c)
[<c00d1984>] (sync_inodes_sb+0x88/0x17c) from [<c00d5c38>] (__sync_filesystem+0x30/0x6c)
[<c00d5c38>] (__sync_filesystem+0x30/0x6c) from [<c00b6248>] (generic_shutdown_super+0x2c/0x130)
[<c00b6248>] (generic_shutdown_super+0x2c/0x130) from [<c00b6368>] (kill_block_super+0x1c/0x38)
[<c00b6368>] (kill_block_super+0x1c/0x38) from [<c00b66c0>] (deactivate_super+0x68/0x8c)
[<c00b66c0>] (deactivate_super+0x68/0x8c) from [<c00cd734>] (sys_umount+0x2c8/0x2fc)
[<c00cd734>] (sys_umount+0x2c8/0x2fc) from [<c00269c0>] (ret_fast_syscall+0x0/0x28)
INFO: task umount:574 blocked for more than 120 seconds.
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
umount        D c03467c0     0   574    567 0x00000000
[<c03467c0>] (schedule+0x360/0x3f0) from [<c00d18f0>] (bdi_sched_wait+0xc/0x18)
[<c00d18f0>] (bdi_sched_wait+0xc/0x18) from [<c03472e4>] (__wait_on_bit+0x60/0xac)
[<c03472e4>] (__wait_on_bit+0x60/0xac) from [<c03473a4>] (out_of_line_wait_on_bit+0x74/0x80)
[<c03473a4>] (out_of_line_wait_on_bit+0x74/0x80) from [<c00d1984>] (sync_inodes_sb+0x88/0x17c)
[<c00d1984>] (sync_inodes_sb+0x88/0x17c) from [<c00d5c38>] (__sync_filesystem+0x30/0x6c)
[<c00d5c38>] (__sync_filesystem+0x30/0x6c) from [<c00b6248>] (generic_shutdown_super+0x2c/0x130)
[<c00b6248>] (generic_shutdown_super+0x2c/0x130) from [<c00b6368>] (kill_block_super+0x1c/0x38)
[<c00b6368>] (kill_block_super+0x1c/0x38) from [<c00b66c0>] (deactivate_super+0x68/0x8c)
[<c00b66c0>] (deactivate_super+0x68/0x8c) from [<c00cd734>] (sys_umount+0x2c8/0x2fc)
[<c00cd734>] (sys_umount+0x2c8/0x2fc) from [<c00269c0>] (ret_fast_syscall+0x0/0x28)



Is this related to busybox and is there a known workaround for this or is this more kernel related?

If I manually umount before unplugging the pendrive everything works like a charm.

Many thanks for helping,
Dieter



More information about the busybox mailing list