Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 301627 - "ioctl failed" error with sys-fs/cryptsetup-1.0.7-r1 when luksOpening LVM snapshots
Summary: "ioctl failed" error with sys-fs/cryptsetup-1.0.7-r1 when luksOpening LVM sna...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Gentoo's Team for Core System packages
URL: http://code.google.com/p/cryptsetup/i...
Whiteboard:
Keywords:
Depends on: 294934
Blocks:
  Show dependency tree
 
Reported: 2010-01-20 14:20 UTC by Wonko
Modified: 2011-01-07 23:32 UTC (History)
0 users

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


Attachments
strace of cryptsetup command (cryptsetup-error.strace,47.01 KB, text/plain)
2010-01-20 14:21 UTC, Wonko
Details
strace of cryptsetup command (cryptsetup-ok.strace,47.13 KB, text/plain)
2010-01-20 14:23 UTC, Wonko
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Wonko 2010-01-20 14:20:34 UTC
I have a system consisting of many LVMs, all of them encrypted. My system backup script creates an LVM snapshot of the partition to back up, opens the snapshot with cryptsetup, mounts it and backs it up. This fails for some LVm volumes with sys-fs/cryptsetup-1.0.7-r1 (with others, it still works). A downgrade to 1.0.6-r2 makes it work again.


Reproducible: Sometimes

Steps to Reproduce:
1. lvcreate -L 1G -n foo myvg
2. cryptsetup luksFormat -c aes-xts-plain -s 256 /dev/myvg/foo /etc/mykey
3. cryptsetup luksOpen -d /etc/mykey /dev/myvg/foo bar
4. lvcreate -L 1G -n foo-snapshot --snapshot /dev/myvg/foo
5. cyyptsetup luksOpen -d /etc/mykey /dev/myvg/foo-snapshot bar-snapshot
At least this should create a setup similar to mine. The URL I pasted above seems to show the same problem, but I am not sure.
Actual Results:  
I get this error:
key slot 0 unlocked.
Command failed: device-mapper: create ioctl failed: Device or resource busy

Well, for most of my partitions. A snapshot of my small root partition still opens fine.

Expected Results:  
This should appear:
key slot 0 unlocked.
Command successful.


Portage 2.2_rc61 (default/linux/x86/10.0/desktop, gcc-4.3.4, glibc-2.11-r1, 2.6.31-tuxonice_k8 i686)
=================================================================
System uname: Linux-2.6.31-tuxonice_k8-i686-AMD_Athlon-tm-_Dual_Core_Processor_4850e-with-gentoo-2.0.1
Timestamp of tree: Fri, 15 Jan 2010 18:15:03 +0000
distcc 3.1 i686-pc-linux-gnu [enabled]
ccache version 2.4 [enabled]
app-shells/bash:     4.0_p35
dev-java/java-config: 2.1.10
dev-lang/python:     2.6.4, 3.1.1-r1
dev-util/ccache:     2.4-r8
dev-util/cmake:      2.8.0
sys-apps/baselayout: 2.0.1
sys-apps/openrc:     0.6.0
sys-apps/sandbox:    2.2
sys-devel/autoconf:  2.13, 2.63-r1
sys-devel/automake:  1.7.9-r2, 1.8.5-r4, 1.9.6-r3, 1.10.3, 1.11.1
sys-devel/binutils:  2.20
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.6b
virtual/os-headers:  2.6.30-r1
ACCEPT_KEYWORDS="x86 ~x86"
ACCEPT_LICENSE="* -@EULA"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=k8-sse3 -mfpmath=sse -O2 -pipe -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /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/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/splash /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-march=k8-sse3 -mfpmath=sse -O2 -pipe -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--with-bdeps y"
FEATURES="assume-digests buildpkg buildsyspkg ccache collision-protect distcc distlocks fixpackages news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unmerge-logs unmerge-orphans userfetch userpriv usersandbox"
GENTOO_MIRRORS="http://de-mirror.org/distro/gentoo/ ftp://gentoo.imj.fr/pub/gentoo/ http://mirror.leaseweb.com/gentoo/ ftp://mirror.leaseweb.com/gentoo/"
LANG="de_DE.utf8"
LDFLAGS="-Wl,-O1"
LINGUAS="de"
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/tree"
PORTDIR_OVERLAY="/usr/local/portage/layman/kde-testing /usr/local/portage/layman/sunrise /usr/local/portage/layman/science /usr/local/portage/layman/zugaina /usr/local/portage/layman/armagetron /usr/local/portage/layman/kde-sunset /usr/local/portage"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="3dnow X a52 aac aalib acl acpi aim alsa apm audiofile bash-completion bcmath berkdb bluetooth branding bzip2 cairo cdparanoia cdr cli consolekit cracklib crypt ctype cups cvs cxx dbus dga directfb dri dts dvb dvd dvdr eds emacs emboss encode evo fam fbcon ffmpeg firefox flac foomaticdb fortran ftp gd gdbm ggi gif gimp ginac gnome gphoto2 gpm gstreamer gtk hal handbook hddtemp iconv ieee1394 imagemagick imlib ipv6 jabber jack java javascript jbig jpeg jpeg2k kde latex ldap libnotify lirc lm_sensors mad maildir matroska matrox mikmod mime mmx mng modplug modules motif mp3 mp4 mpeg mplayer msn mudflap musepack musicbrainz nas ncurses nls nptl nptlonly nsplugin ogg openal opengl openmp oss pam pcre pdf perl php plotutils png ppds pppd python qt3support qt4 quicktime radius readline recode reflection ruby samba scanner sdl semantic-desktop session slang slp sndfile sockets sox speex spell spl sse sse2 sse3 ssl startup-notification subversion svg svga sysfs tcpd theora threads thunar tiff truetype unicode usb videos vim-syntax visualization vorbis win32codecs wma wmf wxwindows x264 x86 xattr xcomposite xine xml xorg xosd xpm xscreensaver xulrunner xv xvid zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" 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 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" FRITZCAPI_CARDS="fcpci" INPUT_DEVICES="evdev keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="de" LIRC_DEVICES="serial" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="fglrx radeon radeonhd vesa"
Unset:  CPPFLAGS, CTARGET, FFLAGS, INSTALL_MASK, LC_ALL, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Wonko 2010-01-20 14:21:57 UTC
Created attachment 216974 [details]
strace of cryptsetup command

strace log of a failed cryptsetup command
Comment 2 Wonko 2010-01-20 14:23:29 UTC
Created attachment 216977 [details]
strace of cryptsetup command

strace log of a successful cryptsetup command
Comment 3 Peter Volkov (RETIRED) gentoo-dev 2010-01-26 17:25:06 UTC
Since it was fixed in September I guess cryptsetup-1.1.0 should fix this issue... Or if you dig patch from upstream I guess it's possible to apply it for 1.0.7.
Comment 4 SpanKY gentoo-dev 2011-01-07 23:32:36 UTC
newer version is going stable