Package: usbmount
Version: 0.0.14-0.1
Severity: normal
Tags: patch

Hello,

I own a bazillion-in-one USB card reader which registers 4 different 
devices when it is plugged in. As Murphy would have it, the slot which 
actually contains my xD card is always registered last (or 
second-to-last) by udev. Due to usbmount's global lock, this leads to a 
long wait:

Dec 15 11:38:36 x usbmount[28589]: trying to acquire lock 
/var/run/usbmount/.mount.lock
Dec 15 11:38:36 x usbmount[28589]: acquired lock /var/run/usbmount/.mount.lock
Dec 15 11:38:36 x usbmount[28589]: testing whether /dev/sdb is readable
Dec 15 11:38:36 x usbmount[28617]: trying to acquire lock 
/var/run/usbmount/.mount.lock
Dec 15 11:38:36 x usbmount[28632]: trying to acquire lock 
/var/run/usbmount/.mount.lock
Dec 15 11:38:36 x usbmount[28609]: trying to acquire lock 
/var/run/usbmount/.mount.lock
Dec 15 11:38:36 x usbmount[28589]: attempt 0 to read from /dev/sdb failed
Dec 15 11:38:37 x usbmount[28589]: attempt 1 to read from /dev/sdb failed
Dec 15 11:38:38 x usbmount[28589]: attempt 2 to read from /dev/sdb failed
Dec 15 11:38:39 x usbmount[28589]: attempt 3 to read from /dev/sdb failed
Dec 15 11:38:40 x usbmount[28589]: attempt 4 to read from /dev/sdb failed
Dec 15 11:38:41 x usbmount[28589]: attempt 5 to read from /dev/sdb failed
Dec 15 11:38:42 x usbmount[28589]: attempt 6 to read from /dev/sdb failed
Dec 15 11:38:43 x usbmount[28589]: attempt 7 to read from /dev/sdb failed
Dec 15 11:38:44 x usbmount[28589]: attempt 8 to read from /dev/sdb failed
Dec 15 11:38:45 x usbmount[28589]: attempt 9 to read from /dev/sdb failed
Dec 15 11:38:46 x usbmount[28589]: attempt 10 to read from /dev/sdb failed
Dec 15 11:38:47 x usbmount[28589]: attempt 11 to read from /dev/sdb failed
Dec 15 11:38:48 x usbmount[28589]: attempt 12 to read from /dev/sdb failed
Dec 15 11:38:49 x usbmount[28589]: attempt 13 to read from /dev/sdb failed
Dec 15 11:38:50 x usbmount[28589]: attempt 14 to read from /dev/sdb failed
Dec 15 11:38:51 x usbmount[28589]: attempt 15 to read from /dev/sdb failed
Dec 15 11:38:52 x usbmount[28589]: attempt 16 to read from /dev/sdb failed
Dec 15 11:38:53 x usbmount[28589]: attempt 17 to read from /dev/sdb failed
Dec 15 11:38:54 x usbmount[28589]: attempt 18 to read from /dev/sdb failed
Dec 15 11:38:55 x usbmount[28589]: attempt 19 to read from /dev/sdb failed
Dec 15 11:38:56 x usbmount[28589]: cannot read from /dev/sdb
Dec 15 11:39:06 x usbmount[28617]: acquired lock /var/run/usbmount/.mount.lock
Dec 15 11:39:06 x usbmount[28617]: testing whether /dev/sdd is readable
Dec 15 11:39:06 x usbmount[28617]: attempt 0 to read from /dev/sdd failed
Dec 15 11:39:06 x usbmount[28632]: cannot acquire lock 
/var/run/usbmount/.mount.lock
Dec 15 11:39:06 x usbmount[28609]: cannot acquire lock 
/var/run/usbmount/.mount.lock
Dec 15 11:39:06 x usbmount[28748]: trying to acquire lock 
/var/run/usbmount/.mount.lock
Dec 15 11:39:07 x usbmount[28617]: attempt 1 to read from /dev/sdd failed
Dec 15 11:39:08 x usbmount[28617]: attempt 2 to read from /dev/sdd failed
Dec 15 11:39:09 x usbmount[28617]: attempt 3 to read from /dev/sdd failed
Dec 15 11:39:10 x usbmount[28617]: attempt 4 to read from /dev/sdd failed
Dec 15 11:39:11 x usbmount[28617]: attempt 5 to read from /dev/sdd failed
Dec 15 11:39:12 x usbmount[28617]: attempt 6 to read from /dev/sdd failed
Dec 15 11:39:13 x usbmount[28617]: attempt 7 to read from /dev/sdd failed
Dec 15 11:39:14 x usbmount[28617]: attempt 8 to read from /dev/sdd failed
Dec 15 11:39:15 x usbmount[28617]: attempt 9 to read from /dev/sdd failed
Dec 15 11:39:16 x usbmount[28617]: attempt 10 to read from /dev/sdd failed
Dec 15 11:39:17 x usbmount[28617]: attempt 11 to read from /dev/sdd failed
Dec 15 11:39:18 x usbmount[28617]: attempt 12 to read from /dev/sdd failed
Dec 15 11:39:19 x usbmount[28617]: attempt 13 to read from /dev/sdd failed
Dec 15 11:39:20 x usbmount[28617]: attempt 14 to read from /dev/sdd failed
Dec 15 11:39:21 x usbmount[28617]: attempt 15 to read from /dev/sdd failed
Dec 15 11:39:22 x usbmount[28617]: attempt 16 to read from /dev/sdd failed
Dec 15 11:39:23 x usbmount[28617]: attempt 17 to read from /dev/sdd failed
Dec 15 11:39:24 x usbmount[28617]: attempt 18 to read from /dev/sdd failed
Dec 15 11:39:25 x usbmount[28617]: attempt 19 to read from /dev/sdd failed
Dec 15 11:39:26 x usbmount[28617]: cannot read from /dev/sdd
Dec 15 11:39:36 x usbmount[28748]: acquired lock /var/run/usbmount/.mount.lock
Dec 15 11:39:36 x usbmount[28748]: testing whether /dev/sde1 is readable
Dec 15 11:39:36 x usbmount[28748]: /dev/sde1 contains a filesystem or disklabel
Dec 15 11:39:36 x usbmount[28748]: /dev/sde1 contains filesystem type vfat
Dec 15 11:39:36 x usbmount[28748]: mountpoint /media/usb0 is available for 
/dev/sde1
Dec 15 11:39:36 x usbmount[28748]: executing command: mount -tvfat 
-onoexec,nodev,noatime,gid=windows,umask=002 /dev/sde1 /media/usb0
Dec 15 11:39:36 x usbmount[28748]: executing command: run-parts 
/etc/usbmount/mount.d

That's one minute from plugging in the card reader until the card is 
mounted! :-(

The solution to this problem is to have one lock per device, see the 
patch at the end of this report. Using it, the filesystem is mounted 
immediately:

Dec 15 12:08:14 x usbmount[3756]: trying to acquire lock 
/var/run/usbmount/.mount-dev-sde.lock
Dec 15 12:08:14 x usbmount[3736]: trying to acquire lock 
/var/run/usbmount/.mount-dev-sdd.lock
Dec 15 12:08:14 x usbmount[3744]: trying to acquire lock 
/var/run/usbmount/.mount-dev-sdc.lock
Dec 15 12:08:14 x usbmount[3740]: trying to acquire lock 
/var/run/usbmount/.mount-dev-sdb.lock
Dec 15 12:08:14 x usbmount[3736]: acquired lock 
/var/run/usbmount/.mount-dev-sdd.lock
Dec 15 12:08:14 x usbmount[3736]: testing whether /dev/sdd is readable
Dec 15 12:08:14 x usbmount[3736]: attempt 0 to read from /dev/sdd failed
Dec 15 12:08:14 x usbmount[3740]: acquired lock 
/var/run/usbmount/.mount-dev-sdb.lock
Dec 15 12:08:14 x usbmount[3740]: testing whether /dev/sdb is readable
Dec 15 12:08:14 x usbmount[3756]: acquired lock 
/var/run/usbmount/.mount-dev-sde.lock
Dec 15 12:08:14 x usbmount[3756]: testing whether /dev/sde is readable
Dec 15 12:08:14 x usbmount[3744]: acquired lock 
/var/run/usbmount/.mount-dev-sdc.lock
Dec 15 12:08:14 x usbmount[3744]: testing whether /dev/sdc is readable
Dec 15 12:08:14 x usbmount[3740]: attempt 0 to read from /dev/sdb failed
Dec 15 12:08:14 x usbmount[3744]: attempt 0 to read from /dev/sdc failed
Dec 15 12:08:14 x usbmount[3756]: /dev/sde does not contain a filesystem or 
disklabel
Dec 15 12:08:14 x usbmount[3820]: trying to acquire lock 
/var/run/usbmount/.mount-dev-sde1.lock
Dec 15 12:08:14 x usbmount[3820]: acquired lock 
/var/run/usbmount/.mount-dev-sde1.lock
Dec 15 12:08:14 x usbmount[3820]: testing whether /dev/sde1 is readable
Dec 15 12:08:14 x usbmount[3820]: /dev/sde1 contains a filesystem or disklabel
Dec 15 12:08:14 x usbmount[3820]: /dev/sde1 contains filesystem type vfat
Dec 15 12:08:14 x usbmount[3820]: mountpoint /media/usb0 is available for 
/dev/sde1
Dec 15 12:08:14 x usbmount[3820]: executing command: mount -tvfat 
-onoexec,nodev,noatime,gid=windows,umask=002 /dev/sde1 /media/usb0
Dec 15 12:08:14 x usbmount[3820]: executing command: run-parts 
/etc/usbmount/mount.d
Dec 15 12:08:15 x usbmount[3736]: attempt 1 to read from /dev/sdd failed
Dec 15 12:08:15 x usbmount[3740]: attempt 1 to read from /dev/sdb failed
Dec 15 12:08:15 x usbmount[3744]: attempt 1 to read from /dev/sdc failed
Dec 15 12:08:16 x usbmount[3736]: attempt 2 to read from /dev/sdd failed
Dec 15 12:08:16 x usbmount[3740]: attempt 2 to read from /dev/sdb failed
Dec 15 12:08:16 x usbmount[3744]: attempt 2 to read from /dev/sdc failed
Dec 15 12:08:17 x usbmount[3736]: attempt 3 to read from /dev/sdd failed
Dec 15 12:08:17 x usbmount[3740]: attempt 3 to read from /dev/sdb failed
Dec 15 12:08:17 x usbmount[3744]: attempt 3 to read from /dev/sdc failed
Dec 15 12:08:18 x usbmount[3736]: attempt 4 to read from /dev/sdd failed
Dec 15 12:08:18 x usbmount[3740]: attempt 4 to read from /dev/sdb failed
Dec 15 12:08:18 x usbmount[3744]: attempt 4 to read from /dev/sdc failed
Dec 15 12:08:19 x usbmount[3736]: attempt 5 to read from /dev/sdd failed
Dec 15 12:08:19 x usbmount[3740]: attempt 5 to read from /dev/sdb failed
Dec 15 12:08:19 x usbmount[3744]: attempt 5 to read from /dev/sdc failed
Dec 15 12:08:20 x usbmount[3736]: attempt 6 to read from /dev/sdd failed
Dec 15 12:08:20 x usbmount[3740]: attempt 6 to read from /dev/sdb failed
Dec 15 12:08:20 x usbmount[3744]: attempt 6 to read from /dev/sdc failed
Dec 15 12:08:21 x usbmount[3736]: attempt 7 to read from /dev/sdd failed
Dec 15 12:08:21 x usbmount[3740]: attempt 7 to read from /dev/sdb failed
Dec 15 12:08:21 x usbmount[3744]: attempt 7 to read from /dev/sdc failed
Dec 15 12:08:22 x usbmount[3736]: attempt 8 to read from /dev/sdd failed
Dec 15 12:08:22 x usbmount[3740]: attempt 8 to read from /dev/sdb failed
Dec 15 12:08:22 x usbmount[3744]: attempt 8 to read from /dev/sdc failed
Dec 15 12:08:23 x usbmount[3736]: attempt 9 to read from /dev/sdd failed
Dec 15 12:08:23 x usbmount[3740]: attempt 9 to read from /dev/sdb failed
Dec 15 12:08:23 x usbmount[3744]: attempt 9 to read from /dev/sdc failed
Dec 15 12:08:24 x usbmount[3736]: attempt 10 to read from /dev/sdd failed
Dec 15 12:08:24 x usbmount[3740]: attempt 10 to read from /dev/sdb failed
Dec 15 12:08:24 x usbmount[3744]: attempt 10 to read from /dev/sdc failed
Dec 15 12:08:25 x usbmount[3736]: attempt 11 to read from /dev/sdd failed
Dec 15 12:08:25 x usbmount[3740]: attempt 11 to read from /dev/sdb failed
Dec 15 12:08:25 x usbmount[3744]: attempt 11 to read from /dev/sdc failed
Dec 15 12:08:26 x usbmount[3736]: attempt 12 to read from /dev/sdd failed
Dec 15 12:08:26 x usbmount[3740]: attempt 12 to read from /dev/sdb failed
Dec 15 12:08:26 x usbmount[3744]: attempt 12 to read from /dev/sdc failed
Dec 15 12:08:27 x usbmount[3736]: attempt 13 to read from /dev/sdd failed
Dec 15 12:08:27 x usbmount[3740]: attempt 13 to read from /dev/sdb failed
Dec 15 12:08:27 x usbmount[3744]: attempt 13 to read from /dev/sdc failed
Dec 15 12:08:28 x usbmount[3736]: attempt 14 to read from /dev/sdd failed
Dec 15 12:08:28 x usbmount[3740]: attempt 14 to read from /dev/sdb failed
Dec 15 12:08:28 x usbmount[3744]: attempt 14 to read from /dev/sdc failed
Dec 15 12:08:29 x usbmount[3736]: attempt 15 to read from /dev/sdd failed
Dec 15 12:08:29 x usbmount[3740]: attempt 15 to read from /dev/sdb failed
Dec 15 12:08:29 x usbmount[3744]: attempt 15 to read from /dev/sdc failed
Dec 15 12:08:30 x usbmount[3736]: attempt 16 to read from /dev/sdd failed
Dec 15 12:08:30 x usbmount[3740]: attempt 16 to read from /dev/sdb failed
Dec 15 12:08:30 x usbmount[3744]: attempt 16 to read from /dev/sdc failed
Dec 15 12:08:31 x usbmount[3736]: attempt 17 to read from /dev/sdd failed
Dec 15 12:08:31 x usbmount[3740]: attempt 17 to read from /dev/sdb failed
Dec 15 12:08:31 x usbmount[3744]: attempt 17 to read from /dev/sdc failed
Dec 15 12:08:32 x usbmount[3736]: attempt 18 to read from /dev/sdd failed
Dec 15 12:08:32 x usbmount[3740]: attempt 18 to read from /dev/sdb failed
Dec 15 12:08:32 x usbmount[3744]: attempt 18 to read from /dev/sdc failed
Dec 15 12:08:33 x usbmount[3736]: attempt 19 to read from /dev/sdd failed
Dec 15 12:08:33 x usbmount[3740]: attempt 19 to read from /dev/sdb failed
Dec 15 12:08:33 x usbmount[3744]: attempt 19 to read from /dev/sdc failed
Dec 15 12:08:34 x usbmount[3736]: cannot read from /dev/sdd
Dec 15 12:08:34 x usbmount[3740]: cannot read from /dev/sdb
Dec 15 12:08:34 x usbmount[3744]: cannot read from /dev/sdc


--- usbmount.orig       2006-05-01 01:48:06.000000000 +0200
+++ usbmount    2006-12-15 11:57:57.132197000 +0100
@@ -57,11 +57,12 @@
 if test "$1" = add; then
 
     # Acquire lock.
-    log debug "trying to acquire lock /var/run/usbmount/.mount.lock"
-    lockfile-create --retry 3 /var/run/usbmount/.mount || \
-       { log err "cannot acquire lock /var/run/usbmount/.mount.lock"; exit 1; }
-    trap '( lockfile-remove /var/run/usbmount/.mount )' 0
-    log debug "acquired lock /var/run/usbmount/.mount.lock"
+    LOCKFILE=/var/run/usbmount/.mount`echo "$DEVNAME" | sed 's%[^a-z0-9_]%-%g'`
+    log debug "trying to acquire lock $LOCKFILE.lock"
+    lockfile-create --retry 3 $LOCKFILE ||
+       { log err "cannot acquire lock $LOCKFILE.lock"; exit 1; }
+    trap '( lockfile-remove $LOCKFILE )' 0
+    log debug "acquired lock $LOCKFILE.lock"
 
     # Try to read from the device.  Some devices need a few seconds
     # initialization time before they can be accessed.  Give up after


-- System Information:
Debian Release: 4.0
  APT prefers testing
  APT policy: (990, 'testing')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.17.9
Locale: LANG=C, LC_CTYPE=de_DE (charmap=ISO-8859-15)

Versions of packages usbmount depends on:
ii  lockfile-progs                0.1.10     Programs for locking and unlocking
ii  udev                          0.103-1    /dev/ and hotplug management daemo

usbmount recommends no packages.

-- no debconf information


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to