Your message dated Sun, 21 May 2006 07:26:08 -0700
with message-id <[EMAIL PROTECTED]>
and subject line Bug#358388: fixed in cryptsetup 2:1.0.3-1
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

--- Begin Message ---
Package: cryptsetup
Version: 2:1.0.2+1.0.3-rc3-1
Severity: normal
Tags: patch

When creating a filesystem on a RAID it is of advantage to align it on
stripewidth boundaries.  Unfortunately with LUKS the payload starts at a
certain 4k boundary, which usually is not a stripe boundary so using for
instance XFS's sunit and swidth options won't work as expected.

This patch adds a new options --align-payload that allows you to specify
the alignment you want on luksFormat.

For instance here I use cryptsetup -a 384 luksFormat /dev/md5 since md5
is a raid5 of 64k stripes (128 sectors) with 4 disks (3+1).

Please apply.
diff -Nur --exclude Makefile.in --exclude config.guess --exclude config.sub 
--exclude aclocal.m4 --exclude ltmain.sh --exclude configure --exclude 
luksformat.8 c/cryptsetup-1.0.2+1.0.3-rc3/lib/libcryptsetup.h 
cryptsetup-1.0.2+1.0.3-rc3/lib/libcryptsetup.h
--- c/cryptsetup-1.0.2+1.0.3-rc3/lib/libcryptsetup.h    2006-02-20 
22:20:24.000000000 +0100
+++ cryptsetup-1.0.2+1.0.3-rc3/lib/libcryptsetup.h      2006-03-22 
15:22:03.281463152 +0100
@@ -28,6 +28,8 @@
        uint64_t        skip;
        uint64_t        iteration_time;
        uint64_t        timeout;
+
+       uint64_t        align_payload;
 };
 
 int crypt_create_device(struct crypt_options *options);
diff -Nur --exclude Makefile.in --exclude config.guess --exclude config.sub 
--exclude aclocal.m4 --exclude ltmain.sh --exclude configure --exclude 
luksformat.8 c/cryptsetup-1.0.2+1.0.3-rc3/lib/setup.c 
cryptsetup-1.0.2+1.0.3-rc3/lib/setup.c
--- c/cryptsetup-1.0.2+1.0.3-rc3/lib/setup.c    2006-03-15 15:42:10.000000000 
+0100
+++ cryptsetup-1.0.2+1.0.3-rc3/lib/setup.c      2006-03-22 15:21:22.225873378 
+0100
@@ -504,7 +504,7 @@
        r = parse_into_name_and_mode(options->cipher, cipherName, cipherMode);
        if(r < 0) return r;
 
-       r = LUKS_generate_phdr(&header,&mk,cipherName, cipherMode,LUKS_STRIPES);
+       r = LUKS_generate_phdr(&header,&mk,cipherName, cipherMode,LUKS_STRIPES, 
options->align_payload);
        if(r < 0) { 
                set_error("Can't write phdr");
                return r; 
diff -Nur --exclude Makefile.in --exclude config.guess --exclude config.sub 
--exclude aclocal.m4 --exclude ltmain.sh --exclude configure --exclude 
luksformat.8 c/cryptsetup-1.0.2+1.0.3-rc3/luks/keymanage.c 
cryptsetup-1.0.2+1.0.3-rc3/luks/keymanage.c
--- c/cryptsetup-1.0.2+1.0.3-rc3/luks/keymanage.c       2006-03-10 
15:53:38.000000000 +0100
+++ cryptsetup-1.0.2+1.0.3-rc3/luks/keymanage.c 2006-03-22 15:18:39.059511226 
+0100
@@ -144,7 +144,8 @@
 
 int LUKS_generate_phdr(struct luks_phdr *header, 
                       const struct luks_masterkey *mk, const char *cipherName,
-                      const char *cipherMode, unsigned int stripes)
+                      const char *cipherMode, unsigned int stripes,
+                      unsigned int alignPayload)
 {
        unsigned int i=0;
        unsigned int blocksPerStripeSet = 
div_round_up(mk->keyLength*stripes,SECTOR_SIZE);
@@ -153,6 +154,8 @@
        uuid_t partitionUuid;
        int currentSector;
        int alignSectors = 4096/SECTOR_SIZE;
+       if (alignPayload == 0)
+               alignPayload = alignSectors;
 
        memset(header,0,sizeof(struct luks_phdr));
 
@@ -184,6 +187,7 @@
                header->keyblock[i].stripes = stripes;
                currentSector = round_up_modulo(currentSector + 
blocksPerStripeSet, alignSectors);
        }
+       currentSector = round_up_modulo(currentSector, alignPayload);
 
        header->payloadOffset=currentSector;
        uuid_generate(partitionUuid);
diff -Nur --exclude Makefile.in --exclude config.guess --exclude config.sub 
--exclude aclocal.m4 --exclude ltmain.sh --exclude configure --exclude 
luksformat.8 c/cryptsetup-1.0.2+1.0.3-rc3/luks/luks.h 
cryptsetup-1.0.2+1.0.3-rc3/luks/luks.h
--- c/cryptsetup-1.0.2+1.0.3-rc3/luks/luks.h    2005-09-11 16:32:49.000000000 
+0200
+++ cryptsetup-1.0.2+1.0.3-rc3/luks/luks.h      2006-03-22 15:18:53.131369495 
+0100
@@ -83,7 +83,8 @@
 
 int LUKS_generate_phdr(struct luks_phdr *header,
                       const struct luks_masterkey *mk, const char *cipherName,
-                      const char *cipherMode, unsigned int stripes);
+                      const char *cipherMode, unsigned int stripes,
+                      unsigned int alignPayload);
 
 int LUKS_read_phdr(const char *device, struct luks_phdr *hdr);
 
diff -Nur --exclude Makefile.in --exclude config.guess --exclude config.sub 
--exclude aclocal.m4 --exclude ltmain.sh --exclude configure --exclude 
luksformat.8 c/cryptsetup-1.0.2+1.0.3-rc3/man/cryptsetup.8 
cryptsetup-1.0.2+1.0.3-rc3/man/cryptsetup.8
--- c/cryptsetup-1.0.2+1.0.3-rc3/man/cryptsetup.8       2006-02-25 
20:28:38.000000000 +0100
+++ cryptsetup-1.0.2+1.0.3-rc3/man/cryptsetup.8 2006-03-22 15:47:41.339971047 
+0100
@@ -114,6 +114,11 @@
 .B "\-\-timeout, \-t"
 The number of seconds to wait before timeout. This option is relevant evertime 
a password is asked, like \fIcreate\fR, \fIluksOpen\fR, \fIluksFormat\fR or 
\fIluksAddKey\fR.
 .TP
+.B "\-\-align-payload=\fIvalue\fR, \-a"
+Align payload at a boundary of \fIvalue\fR 512-byte sectors.  This option is 
relevant for \fIluksFormat\fR.  If your block device lives on a RAID it is
+useful to align the filesystem at full stripe boundaries so it can take 
advantage of the RAID's geometry.  See for instance the sunit and swidth options
+in the mkfs.xfs manual page.  By default the payload is aligned at an 8 sector 
(4096 byte) boundary.
+.TP
 .B "\-\-version"
 Show the version.
 
diff -Nur --exclude Makefile.in --exclude config.guess --exclude config.sub 
--exclude aclocal.m4 --exclude ltmain.sh --exclude configure --exclude 
luksformat.8 c/cryptsetup-1.0.2+1.0.3-rc3/src/cryptsetup.c 
cryptsetup-1.0.2+1.0.3-rc3/src/cryptsetup.c
--- c/cryptsetup-1.0.2+1.0.3-rc3/src/cryptsetup.c       2006-03-15 
15:03:13.000000000 +0100
+++ cryptsetup-1.0.2+1.0.3-rc3/src/cryptsetup.c 2006-03-22 15:21:53.065565159 
+0100
@@ -27,6 +27,7 @@
 static int opt_batch_mode = 0;
 static int opt_version_mode = 0;
 static int opt_timeout = 0;
+static int opt_align_payload = 8;
 
 static const char **action_argv;
 static int action_argc;
@@ -209,6 +210,7 @@
                .flags = opt_verify_passphrase ? CRYPT_FLAG_VERIFY : 
(!opt_batch_mode?CRYPT_FLAG_VERIFY_IF_POSSIBLE :  0),
                .iteration_time = opt_iteration_time,
                .timeout = opt_timeout,
+               .align_payload = opt_align_payload,
        };
 
        int r = 0; char *msg = NULL;
@@ -370,6 +372,7 @@
                { "batch-mode",        'q',  POPT_ARG_NONE,                     
          &opt_batch_mode,        0, N_("Do not ask for confirmation"),         
                            NULL },
                { "version",        '\0',  POPT_ARG_NONE,                       
        &opt_version_mode,        0, N_("Print package version"),               
                      NULL },
                { "timeout",           't',  POPT_ARG_INT,                      
          &opt_timeout,           0, N_("Timeout for interactive passphrase 
prompt (in seconds)"),          N_("secs") },
+               { "align-payload",     'a',  POPT_ARG_INT,                      
          &opt_align_payload,     0, N_("Align payload at <n> sector boundaries 
- for luksFormat"),         N_("SECTORS") },
                POPT_TABLEEND
        };
        poptContext popt_context;

--- End Message ---
--- Begin Message ---
Source: cryptsetup
Source-Version: 2:1.0.3-1

We believe that the bug you reported is fixed in the latest version of
cryptsetup, which is due to be installed in the Debian FTP archive:

cryptsetup-udeb_1.0.3-1_amd64.udeb
  to pool/main/c/cryptsetup/cryptsetup-udeb_1.0.3-1_amd64.udeb
cryptsetup_1.0.3-1.diff.gz
  to pool/main/c/cryptsetup/cryptsetup_1.0.3-1.diff.gz
cryptsetup_1.0.3-1.dsc
  to pool/main/c/cryptsetup/cryptsetup_1.0.3-1.dsc
cryptsetup_1.0.3-1_amd64.deb
  to pool/main/c/cryptsetup/cryptsetup_1.0.3-1_amd64.deb
cryptsetup_1.0.3.orig.tar.gz
  to pool/main/c/cryptsetup/cryptsetup_1.0.3.orig.tar.gz



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [EMAIL PROTECTED],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Jonas Meurer <[EMAIL PROTECTED]> (supplier of updated cryptsetup package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [EMAIL PROTECTED])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.7
Date: Sat, 13 May 2006 19:45:08 +0200
Source: cryptsetup
Binary: cryptsetup cryptsetup-udeb
Architecture: source amd64
Version: 2:1.0.3-1
Distribution: unstable
Urgency: low
Maintainer: Jonas Meurer <[EMAIL PROTECTED]>
Changed-By: Jonas Meurer <[EMAIL PROTECTED]>
Description: 
 cryptsetup - configures encrypted block devices
 cryptsetup-udeb - configures encrypted block devices (udeb)
Closes: 358386 358388 358422 358452 359277 362564 363007 364153 364203 364529 
365333 365633
Changes: 
 cryptsetup (2:1.0.3-1) unstable; urgency=low
 .
   [ Jonas Meurer ]
   * new upstream release, 1.0.3 final
     - Add alignPayload patch by Peter Palfrader (closes: #358388)
     - meaningful exitcodes and password retrying by Johannes Weißl
       (closes: #359277)
   * add 01_terminal_timeout.dpatch from Andres Salomon <[EMAIL PROTECTED]>.
     - gets rid of getpass(), which is obsolete according to manpage
     - restores the terminal state before doing the timeout (closes: #364153)
   * add 02_docs_tries.dpatch, to describe --tries in the cryptsetup manpage.
   * add 03_stdin_input.dpatch from David Härdeman <[EMAIL PROTECTED]>,
     fixes input from stdin, accepts input with more than 32 characters
     (closes: #364529, #365333)
   * add 04_status_exit_codes.dpatch from David Härdeman <[EMAIL PROTECTED]>,
     fixes the exit codes of 'cryptsetup status'
   * provide a cryptsetup-udeb package (closes: #358422)
   * remove debian/luksformat.8 in clean target (closes: #358386)
   * fix update-rc.d arguments to start cryptdisks in rc0 and rc6.
     it is not really started [but stopped], but still the links need to be
     named S48cryptdisks. otherwise it will be invoked before umountfs.
   * add initramfs cryptroot functionality, thanks to David Härdeman
     <[EMAIL PROTECTED]> for the patch (closes: #358452)
   * rename /lib/cryptsetup/init_functions to cryptdisks.functions
   * move most of /etc/init.d/cryptdisks to cryptdisks.functions.
     /etc/init.d/cryptdisks now does not much more than importing
     cryptdisks.functions. required for running two seperate cryptdisks
     initscripts.
   * split the cryptdisks initscript into cryptdisks-early and cryptdisks.
     actually both scripts do the same except having slightly different output.
     the early script is run before lvm/evms/... are started, and the other one
     after they are started. (closes: #363007)
   * add support for mount to cryptdisks. this makes it possible to use
     keyfiles from removable media. see the crypttab.5 manpage for more
     information.
   * use upstream cryptsetup tries option instead of the shell code in
     cryptdisks. rename cryptdisks 'retry' option to 'tries'.
   * document the fact, that the default settings in /etc/default/cryptdisks
     take only effect if the relevant option is set without a value in
     crypttab. add the environment section to crypttab.5.txt (closes: #364203)
   * update the TODO list.
   * update crypdisks.default
   * run do_swap and do_tmp. Thanks to Riku Voipio <[EMAIL PROTECTED]>
     (closes: #365633)
   * bump Standards-Version to 3.7.2.0, no changes needed
 .
   [ David Härdeman ]
   * add lvm capabilities to initramfs scripts (closes: #362564)
   * add cryptsetup.postinst which executes update-initramfs when
     cryptsetup is first installed (not on upgrades)
Files: 
 183b038ce477656952988130a2eb09cc 813 admin optional cryptsetup_1.0.3-1.dsc
 7fbb5a7684c572b1e1ce154aee1ddd86 422578 admin optional 
cryptsetup_1.0.3.orig.tar.gz
 59c6a0940ec637773e194c2bcb9f38d0 36164 admin optional 
cryptsetup_1.0.3-1.diff.gz
 0891808596ec175f0661d59ca955c263 245486 admin optional 
cryptsetup_1.0.3-1_amd64.deb
 9845613a7cba974a30cf1d7f6a1b1d84 182546 debian-installer optional 
cryptsetup-udeb_1.0.3-1_amd64.udeb
Package-Type: udeb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)

iD8DBQFEaJ9wd6lUs+JfIQIRAjOcAJ9yqMlTOJ8I4D7+zdIc9W4s/7NciQCfe9ND
yJMAjoaRQ52SL+jzqv8wlhs=
=kLdv
-----END PGP SIGNATURE-----


--- End Message ---

Reply via email to