From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from nymeria.archlinux.org (nymeria.archlinux.org [IPv6:2a00:1828:2000:547::2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.server123.net (Postfix) with ESMTPS for ; Wed, 23 Jul 2014 00:42:50 +0200 (CEST) Message-ID: <53CEE763.4030409@archlinux.org> Date: Wed, 23 Jul 2014 00:36:19 +0200 From: =?ISO-8859-15?Q?Thomas_B=E4chler?= MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="gPjdB0p7EDDQBf60Eo2OVno2JgvinNJAp" Subject: [dm-crypt] libcryptsetup kernel feature detection fails on boot List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: dm-crypt@saout.de, Milan Broz This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --gPjdB0p7EDDQBf60Eo2OVno2JgvinNJAp Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Since cryptsetup 1.6.5, libcryptsetup fails to detect the kernel's features on boot. In particular, whenever the dm-crypt module is not loaded before configuring a mapping with libcryptsetup, the allow_discards option is not used. # rmmod dm_crypt # /usr/lib/systemd/systemd-cryptsetup attach test /dev/loop0 none allow-discards,tries=3D0 Please enter passphrase for disk test! **** Set cipher aes, mode xts-plain64, key size 256 bits for device /dev/loop0= =2E # cryptsetup status test /dev/mapper/test is active. type: LUKS1 cipher: aes-xts-plain64 keysize: 256 bits device: /dev/loop0 loop: /tmp/testfile offset: 4096 sectors size: 405504 sectors mode: read/write # /usr/lib/systemd/systemd-cryptsetup detach test # /usr/lib/systemd/systemd-cryptsetup attach test /dev/loop0 none allow-discards,tries=3D0 Please enter passphrase for disk test! **** Set cipher aes, mode xts-plain64, key size 256 bits for device /dev/loop0= =2E # cryptsetup status test /dev/mapper/test is active. type: LUKS1 cipher: aes-xts-plain64 keysize: 256 bits device: /dev/loop0 loop: /tmp/testfile offset: 4096 sectors size: 405504 sectors mode: read/write flags: discards The culprit seems to be dm_check_versions() in lib/libdevmapper.c - the version number returned here differs when dm_crypt is not loaded. --gPjdB0p7EDDQBf60Eo2OVno2JgvinNJAp Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBAgAGBQJTzudlAAoJEChPw0yOSxolkkIQAMcIHLorHahPCDroxy+edXjm spnXM/xCllz+zzKTLYNHncKMGxW7P4b6OaIZXMAQDwEgXshYrdAsWRiImngvRTPw CkZkI5PYJGko0WKqxVhDNFyxwoNIV2OX7Uh9rBv6ORpfLvvYNRqus5yAPce34Rxi kPRx1DYFO8D69en12hLO4ZsLOfzxojnYH7341v4ntulT2pgNIqk/O7vc52tWodOi g9pdeJW+rZAP+Sz/JgCpXWAHrMOQ2Sd0wIF9WqqETSNtGUiyKn72hU1y6iUNFgC4 jTVBBwww2EZuv2Hl4nXnMYgzFdtsV9hxLBvQOt0dCoQ7q+mfTtkSExtg70b8O2Co tvXOKu7MGhkL3LAgLZ1eFgHIerd8uosb8IK4m2jJWwrq3l259KyED2miKykMIvSU TwawpR7zfK1+aJjTMqGK9ez+zjo924jYVo4a6gjNm4xo86iJ071TaNPxwUgBiORE m3vQy2tEDLGoeDvOVP/FoTZhDL90WWFDDh+YcO3dgiymC0/hMmTpIFZkD8j3y22l 8zr2StShbNudcZc+a0+5bqqPMbu4JlYE+KKms0ufIOppsjLGNwji5rWetMXGGvm+ G4BF8VctFccpG/DBuJP0i5QsButBZqpWLOCLrfUch0imz5LoPKj1TFD2NK0vaWKK ZS70NkCo3OEInekB064+ =9rgn -----END PGP SIGNATURE----- --gPjdB0p7EDDQBf60Eo2OVno2JgvinNJAp--