Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 338185 - sys-fs/udisks:0 has issues with floppies (pinpointed to certain upstream commit), fixed in sys-fs/udisks:2
Summary: sys-fs/udisks:0 has issues with floppies (pinpointed to certain upstream comm...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Freedesktop bugs
URL: https://bugs.freedesktop.org/show_bug...
Whiteboard:
Keywords:
: 453744 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-09-20 12:20 UTC by Ian Abbott
Modified: 2013-01-25 18:04 UTC (History)
2 users (show)

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


Attachments
Partial strace from running /usr/libexec/udisks-daemon (udisks-daemon.2306,19.12 KB, text/plain)
2010-09-20 13:26 UTC, Ian Abbott
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ian Abbott 2010-09-20 12:20:37 UTC
If udisks-daemon is started (say, by the GNOME desktop), any attempt to mount a file system on a floppy drive by any user with the 'mount' command is thwarted.  According to strace, the mount itself succeeds, but then 'udisks-daemon' immediately unmounts it afterwards!

This problem does not occur with sys-fs/udisks-1.0.1-r1 so I think the 'udisks-1.0.1-no-floppy.patch' applied by -r2 is to blame.

A workaround is to use the udisks command to mount the floppy; e.g.:

   udisks --mount /dev/fd0  # assuming /dev/fd0 is in /etc/fstab

Reproducible: Always

Steps to Reproduce:
1. Make sure udisks-daemon from udisks-1.0.1-r2 is running - on my system it is started by GNOME or gdm (not sure which)
2. Try to mount a floppy with a file system - e.g. mount -t vfat /dev/fd0 /mnt/floppy
3. Run 'mount' and see that the floppy is no longer mounted!

Actual Results:  
The floppy is automatically unmounted as soon as you mount it.

Expected Results:  
Floppy should remain mounted.

The following bug report in Ubuntu seems related:
https://bugs.launchpad.net/ubuntu/+source/udisks/+bug/599915

# emerge --info
Portage 2.1.9.5 (default/linux/x86/10.0/desktop, gcc-4.4.4, glibc-2.12.1-r1, 2.6.35-gentoo-r6-ija1 i686)
=================================================================
System uname: Linux-2.6.35-gentoo-r6-ija1-i686-AMD_Duron-tm-_processor-with-gentoo-2.0.1
Timestamp of tree: Tue, 14 Sep 2010 08:15: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.3
sys-apps/sandbox:    2.3-r1
sys-devel/autoconf:  2.13::<unknown repository>, 2.67
sys-devel/automake:  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
sys-devel/make:      3.81-r2
virtual/os-headers:  2.6.35 (sys-kernel/linux-headers)
ACCEPT_KEYWORDS="x86 ~x86"
ACCEPT_LICENSE="*"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=athlon -O2 -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /var/lib/hsqldb"
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=athlon -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests distlocks fixlafiles fixpackages news parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn 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"
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"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X a52 aac acl acpi adns alsa avahi berkdb bluetooth branding bzip2 cairo cdr cjk cli consolekit cracklib crypt cups curl cxx dbus doc dri dts dv dvd dvdr eds emboss encode esd evo exif expat fam firefox flac flash fontconfig fortran gdbm gif glut gmp gnome gnome-keyring gnutls gpm gstreamer gtk gtkhtml guile hal iconv idn imagemagick imap imlib ipv6 java jpeg lcms ldap libnotify mad mikmod mmx mng modules mono motif mozsvg mp3 mp4 mpeg mudflap ncurses nls no-helper nptl nsplugin offensive ogg opengl openmp pam pango pcre pdf perl plotutils png policykit ppds pppd python qemu-fast qt3 qt3support qt4 readline reflection samba sdl semantic-desktop session slang snmp softmmu spell sqlite ssl startup-notification svg sysfs tcltk tcpd tetex threads tiff tk truetype unicode usb vorbis win32codecs x264 x86 xcb xine xml xorg xulrunner xv xvid zlib" ALSA_CARDS="ens1371" 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, MAKEOPTS, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Ian Abbott 2010-09-20 13:26:02 UTC
Created attachment 248163 [details]
Partial strace from running /usr/libexec/udisks-daemon

There were two udisks-daemon processes running, one is a child of the other.  This strace is from the parent (process 2306) showing what happens when the 'mount' command is used to mount the floppy. The interesting part is where it (falsely) decides there is no media in the drive and causes it to be forcibly unmounted (around line 108 of the trace).

The reason it decided there was no media in the drive is because of the "no_floppy" patch applied to the sources.
Comment 2 Ian Abbott 2010-09-20 16:23:14 UTC
I filed a bug report upstream:

https://bugs.freedesktop.org/show_bug.cgi?id=30283
Comment 3 Samuli Suominen (RETIRED) gentoo-dev 2010-12-02 15:42:45 UTC
1.0.2 is tree now, and it includes the patch that caused the problem in the first place... upstream bug still open :/
Comment 4 Samuli Suominen (RETIRED) gentoo-dev 2011-02-06 15:02:58 UTC
Wait, you have floppy drive in /etc/fstab? It shouldn't be there if handled by udisks (udev).   I guess this would be "INVALID" then...
Comment 5 Gilles Dartiguelongue (RETIRED) gentoo-dev 2011-02-07 09:36:29 UTC
well, it still isn't nice to crash, right ?
Comment 6 Ian Abbott 2011-02-07 11:25:33 UTC
(In reply to comment #4)
> Wait, you have floppy drive in /etc/fstab? It shouldn't be there if handled by
> udisks (udev).   I guess this would be "INVALID" then...
> 
I can confirm that taking the floppy drive out of /etc/fstab allows it to be mounted with the 'mount' command, but only by 'root'.

Trying to mount the floppy by opening the 'Floppy Drive' icon in the 'computer:///' (Computer) location in nautilus still fails with the error 'No medium in the drive', which I think is due to same bug, or at least a very similar bug.
Comment 7 partik 2011-05-24 09:04:10 UTC
I have the same problem.
Also you'll get an error message trying to unmount floppy:

# udisks --unmount /dev/fd0
Unmount failed: Cannot unmount because file system on device is busy

You must kill udisks-daemon to unmount it.
Comment 8 Samuli Suominen (RETIRED) gentoo-dev 2012-09-29 11:32:18 UTC
http://bugs.freedesktop.org/show_bug.cgi?id=30283#c26

Solution: Use sys-fs/udisks:2 instead of sys-fs/udisks:0
Comment 9 Ian Abbott 2012-10-01 09:16:09 UTC
(In reply to comment #8)
> http://bugs.freedesktop.org/show_bug.cgi?id=30283#c26
> 
> Solution: Use sys-fs/udisks:2 instead of sys-fs/udisks:0

I suppose that means waiting for Gentoo to update Gnome or for a udisks2 patch to be developed for gnome-base/libgdu-3.0.2.
Comment 10 Ian Abbott 2012-10-01 09:25:17 UTC
(In reply to comment #9)
> (In reply to comment #8)
> > http://bugs.freedesktop.org/show_bug.cgi?id=30283#c26
> > 
> > Solution: Use sys-fs/udisks:2 instead of sys-fs/udisks:0
> 
> I suppose that means waiting for Gentoo to update Gnome or for a udisks2
> patch to be developed for gnome-base/libgdu-3.0.2.

... though perhaps not.  I currently have the 'gdu' local USE flag set for gnome-base/gvfs in my /etc/portage/package.use but it probably isn't needed any more as gvfs also has the 'udisks' local USE flag set in my system's make.profile cascade.
Comment 11 Samuli Suominen (RETIRED) gentoo-dev 2012-10-01 13:45:17 UTC
Use USE="udev udisks" instead of USE="udev gdu" for gnome-base/gvfs. The USE="udev udisks" is already the default for ~arch >=gnome-base/gvfs-1.12.3-r1. And will move to stable soon as we are ready to stabilize newer udev, messing with udev-171-r* is a waste of time as so so many fixes have landed to >=udev-192.

So anyone suffering this problem: Change gvfs to use UDisks2 and drop any legacy programs still using UDisks1 as it's really going away...
Comment 12 Samuli Suominen (RETIRED) gentoo-dev 2013-01-25 04:28:39 UTC
*** Bug 453744 has been marked as a duplicate of this bug. ***
Comment 13 Samuli Suominen (RETIRED) gentoo-dev 2013-01-25 04:35:14 UTC
while sys-fs/udisks:2 is the real fix, I've now also added

+*udisks-1.0.4-r5 (25 Jan 2013)
+
+  25 Jan 2013; Samuli Suominen <ssuominen@gentoo.org> +udisks-1.0.4-r5.ebuild,
+  +files/udisks-1.0.4-revert-floppy.patch:
+  Revert part of upstream commit that prevented UDisks1 from polling for floppy
+  drive so often but while at it broke the actual mounting of floppies wrt
+  #338185 by Ian Abbott and others

luckily udisks:2 is in stable now too (at least for amd64, others pending)
Comment 14 Rick Jenkins 2013-01-25 18:04:10 UTC
Updated udisks and floppies now work. Thanks for all your efforts.

It's not clear if the patch is the fix, since udiscs2 is now stable for x86, and the update brought in both:

> equery list udisks
 * Searching for udisks ...
[IP-] [  ] sys-fs/udisks-1.0.4-r5:0
[IP-] [  ] sys-fs/udisks-2.0.91:2