Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 331065 - sys-fs/udisks-1.0.1-r1: udisks-helper-drive-detach fails unless kernel has CONFIG_USB_SUSPEND
Summary: sys-fs/udisks-1.0.1-r1: udisks-helper-drive-detach fails unless kernel has CO...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Freedesktop bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-03 16:30 UTC by Ian Abbott
Modified: 2013-07-18 20:02 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ian Abbott 2010-08-03 16:30:23 UTC
I think the ebuild should issue a warning if the kernel doesn't have CONFIG_USB_SUSPEND configured.

When right-clicking on a auto-mounted USB drive icon in nautilus and selecting the "Safely Remove Drive" option, the file system was unmounted OK, but nautilus threw up an error dialog similar to this:

------------------------------------------------------------
(-) Unable to stop drive

Error detaching: helper exited with exit code 1: Detaching device /dev/sdb
USB device: /sys/devices/pci0000:00/0000:00:02.1/usb2/2-5)
SYNCHRONIZE CACHE: FAILED: Success
(Continuing despite SYNCHRONIZE CACHE failure.)
STOP UNIT: OK
Unbinding USB interface driver: OK
Suspending USB device: FAILED: Cannot open /sys/devices/pci0000:00/0000:00:02.1/usb2/2-5/power/level for writing: No such file or directory
------------------------------------------------------------

Most of the output above originates from the /usr/libexec/udisks-helper-drive-detach program launched by the udisks-daemon daemon. This udisks-helper-drive-detach program is exiting with exit code 1 after failing to open the power management sysfs attributes for the USB drive.

It turns out that this is because I did not have CONFIG_USB_SUSPEND configured in my kernel.

It might be worth checking for kernel option CONFIG_USB_SUSPEND in the udisks ebuild and issuing a warning if not present (see sys-fs/cryptsetup for an example of checking for kernel config options).

Reproducible: Always

Steps to Reproduce:
1. Configure kernel without CONFIG_USB_SUSPEND. Build it and boot into it.
2. Logon into GNOME desktop.
3. Plug in an automountable USB drive.
4. Right-click on the drive icon on GNOME desktop and select "Safely Remove Drive".
Actual Results:  
The drive icon disappears, but the big, fat error dialog appears. The "mount" command shows that the filesystem is not mounted.

Expected Results:  
I guess the results are as expected if it's assuming the kernel has CONFIG_USB_SUSPEND support.

$ emerge --info
Portage 2.1.8.3 (default/linux/amd64/10.0/desktop, gcc-4.4.4, glibc-2.11.2-r0, 2.6.34-gentoo-r2-ija1 x86_64)
=================================================================
System uname: Linux-2.6.34-gentoo-r2-ija1-x86_64-AMD_Athlon-tm-_64_X2_Dual_Core_Processor_3800+-with-gentoo-2.0.1
Timestamp of tree: Mon, 02 Aug 2010 15:45:01 +0000
app-shells/bash:     4.1_p7
dev-java/java-config: 2.1.11
dev-lang/python:     2.6.5-r3, 3.1.2-r4
dev-util/cmake:      2.8.1-r2
sys-apps/baselayout: 2.0.1
sys-apps/openrc:     0.6.1-r1
sys-apps/sandbox:    2.2
sys-devel/autoconf:  2.13, 2.65-r1
sys-devel/automake:  1.8.5-r4, 1.9.6-r3, 1.10.3, 1.11.1
sys-devel/binutils:  2.20.1-r1
sys-devel/gcc:       3.3.6-r1, 3.4.6-r2, 4.2.4-r1, 4.3.5, 4.4.4-r1
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.10
virtual/os-headers:  2.6.34
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=k8 -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/X11/xkb /usr/share/config"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-march=k8 -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests distlocks fixpackages news parallel-fetch protect-owned sandbox sfperms strict unmerge-logs unmerge-orphans userfetch"
GENTOO_MIRRORS="http://www.mirrorservice.org/sites/www.ibiblio.org/gentoo http://gentoo.oregonstate.edu http://www.ibiblio.org/pub/Linux/distributions/gentoo"
LANG="en_GB.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="en en_GB"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage/layman/desktop-effects /usr/local/portage"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="X a52 aac acl acpi adns alsa amd64 avahi berkdb branding bzip2 cairo cdr cgi cjk cli consolekit cracklib crypt cscope cups curl cxx dbus djvu doc dri dts dv dvd dvdr eds emboss encode esd evo exif expat fam ffmpeg firefox flac flash fortran gdbm gif glut gmp gnome gnome-keyring gnutls gpm graphviz gstreamer gtk gtkhtml guile hal htmlhandbook iconv idn imagemagick imap imlib ipod ipv6 java jpeg kde kerberos lcms ldap libnotify mad mikmod mmx mng modules mono motif mozsvg mp3 mp4 mpeg mudflap multilib musicbrainz ncurses nls no-helper nptl nptlonly nsplugin offensive ogg opengl openmp pam pango pcre pdf perl plotutils png policykit ppds pppd pulseaudio python qt3 qt3support qt4 quicktime rdesktop readline reflection ruby samba sasl sdl semantic-desktop session slang snmp spell spl sqlite sse sse2 ssl startup-notification svg sysfs tcl tcltk tcpd tetex threads tiff tk truetype unicode usb vnc vorbis x264 xcb xine xml xorg xulrunner xv xvid zlib" ALSA_CARDS="hda-intel" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en en_GB" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="radeon ati vesa fbdev" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account" 
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LC_ALL, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Fab 2010-08-03 17:30:30 UTC
Behavior confirmed here with gnome on stable x86.

Unfortunately, when I try to rebuild my kernel with CONFIG_USB_SUSPEND and boot on it, it seems to crash sys-fs/udev-151-r4 into an infinite loop : I must hard-reset and boot another kernel without CONFIG_USB_SUSPEND to restore previous situation.
Comment 2 Fab 2010-08-03 20:25:01 UTC
> Unfortunately, when I try to rebuild my kernel with CONFIG_USB_SUSPEND and boot
> on it, it seems to crash sys-fs/udev-151-r4 into an infinite loop : I must
> hard-reset and boot another kernel without CONFIG_USB_SUSPEND to restore
> previous situation.
 
In fact udev was not in fault. I was simply falling into an endless loop while trying to load modules from app-emulation/virtualbox-modules. I must probably rebuild them.

Now that CONFIG_USB_SUSPEND is built in my kernel everything is fine with automounting and unmounting from nautilus.
Comment 3 Samuli Suominen (RETIRED) gentoo-dev 2010-10-18 13:03:22 UTC
yes, that makes sense:

13:00 < nirbheek> "remove disk" umounts and then powers down the device
13:01 < nirbheek> that needs usb-suspend
13:03 < nirbheek> ssuominen, by "powers down the device" I meant the USB hub itself
13:04 < nirbheek> so that it doesn't supply 5V to anything attached


[and agreed by few other people]

+  18 Oct 2010; Samuli Suominen <ssuominen@gentoo.org>
+  udisks-1.0.1-r2.ebuild:
+  Check for CONFIG_USB_SUSPEND wrt #331065 by Ian Abbott.
Comment 4 xenon 2013-07-18 19:25:36 UTC
Sorry for resurrecting this old bug. I just noticed that udisks ebuilds from both slots check for CONFIG_USB_SUSPEND and print a non-blocking error. The option was removed from the kernel starting with version 3.10 (see http://www.mail-archive.com/linux-usb@vger.kernel.org/msg18514.html for reference).

While the issue seems to be harmless (at least when CONFIG_PM_PRUNTIME is selected in the kernel), the warning/error can be misleading for users. I guess the check in the ebuild should become conditional, depending on the kernel version.
Comment 5 xenon 2013-07-18 20:02:42 UTC
Apologies, the option was removed in kernel version 3.9. Related documentation was updated in 3.10.