Thread (2 messages) 2 messages, 2 authors, 2012-01-31

Re: [dm-crypt] Kernel BUG (fs/bio.c:1499) when copying more files to an encrypted device

flat view

From: Luzipher McLeod <hidden>
Date: 2012-01-31 23:26:05

Hi list,

I just wanted to know if there is interest in solving this bug (see below). I'd need some help with creating a working patch for bio_multi_split, so I could test if it solves my problem.
If nobody has any further suggestions, I'll just use lvm instead of linear, as it's a temporary backup anyway.

Thanks and regards,
Luzipher


--- On Mon, 30/1/12, Luzipher McLeod <luziphermcleod@yahoo.ie> wrote:
quoted hunk ↗ jump to hunk
From: Luzipher McLeod <redacted>
Subject: Re: [dm-crypt] Kernel BUG (fs/bio.c:1499) when copying more files to an encrypted device
To: "Mandeep Singh Baines" <redacted>
Cc: dm-crypt@saout.de, linux-raid@vger.kernel.org
Date: Monday, 30 January, 2012, 0:46
Hi Mandeep,

sorry for the long delay, I couldn't get around to try this
earlier.
I did as you suggested and copied the bio_multi_split
function into bio.c, and added its signature to bio.h (as
done by the original patch by Neil Brown). Then I replaced
the call to bio_split with bio_multi_split in
linear_make_request.
Unfortunately I fail with the forward-porting. Compilation
results in:

fs/bio.c: In function 'bio_multi_split':
fs/bio.c:1585:23: error: 'struct bio' has no member named
'bi_iocnt'
fs/bio.c:1591:8: error: 'struct bio' has no member named
'bi_offset'
fs/bio.c:1592:15: error: 'struct bio' has no member named
'bi_offset'
fs/bio.c:1593:5: error: 'struct bio' has no member named
'bi_offset'
fs/bio.c:1598:12: error: 'struct bio' has no member named
'bi_offset'
make[1]: *** [fs/bio.o] Error 1
make: *** [fs] Error 2

Further examination reveals, that 'struct bio', as defined
in blk_types.h really doesn't have those members anymore and
I can't determine an easy replacement for those. The whole
original patch also doesn't touch 'struct bio', so I'm at a
loss what to do.

Thanks for any pointers or hints how to resolve this !

Regards,
Luzipher



--- On Wed, 25/1/12, Mandeep Singh Baines <msb@chromium.org>
wrote:
quoted
From: Mandeep Singh Baines <redacted>
Subject: Re: [dm-crypt] Kernel BUG (fs/bio.c:1499) when
copying more files to an encrypted device
quoted
To: "Mandeep Singh Baines" <redacted>
Cc: "Luzipher McLeod" <redacted>,
dm-crypt@saout.de,
linux-raid@vger.kernel.org
quoted
Date: Wednesday, 25 January, 2012, 23:46
+cc linux-raid

Mandeep Singh Baines (msb@chromium.org)
wrote:
quoted
Luzipher McLeod (luziphermcleod@yahoo.ie)
wrote:
quoted
quoted
Hi Mandeep,

Thanks fpr your quick answer. So, what can be
done
quoted
about this ? Should I try to apply that patch you
linked to
quoted
? (but I guess a patch from 2007 won't apply cleanly
...)
quoted
quoted
quoted
Hi Luzipher,

I wouldn't apply the patch directly. Just copy
bio_multi_split (might
quoted
need to do some forward porting) and then modify
linear_make_request to
quoted
use bio_multi_split instead of bio_split.

But I'm not really an expert on this particular
code.
quoted
I'm hoping someone
quoted
else will confirm that this is in fact the bug and
not
quoted
a side effect of
quoted
something else. Its seem reasonble that you could
get a
quoted
bio that is
quoted
multi-page and falls on a boundary (spans two or
more
quoted
devices). So I
quoted
suspect this is the bug.

Regards,
Mandeep
quoted
Regards,
Luzipher


--- On Wed, 25/1/12, Mandeep Singh Baines
[off-list ref]
quoted
wrote:
quoted
quoted
quoted
From: Mandeep Singh Baines <redacted>
Subject: Re: [dm-crypt] Kernel BUG
(fs/bio.c:1499) when copying more files to an
encrypted
quoted
device
quoted
quoted
quoted
To: "Luzipher McLeod" <redacted>
Cc: dm-crypt@saout.de,
"NeilBrown" [off-list ref]
quoted
quoted
quoted
Date: Wednesday, 25 January, 2012, 2:14
Luzipher McLeod (luziphermcleod@yahoo.ie)
wrote:
quoted
Hi :-)

A few days ago I encountered a
kernel
quoted
bug while copying
quoted
quoted
quoted
files to an encrypted filesystem. The
specific stack for the
quoted
quoted
quoted
filesystem is:
btrfs-on-crypt-on-mdraid.
quoted
Vasts amounts of
quoted
quoted
quoted
data copied without problems (about
6.3TB
quoted
with 1.1 TB
quoted
quoted
quoted
remaining), but when copying a certain
directory, the kernel
quoted
quoted
quoted
bug surfaces. I repeatedly deleted the
affected directory
quoted
quoted
quoted
and tried to re-copy it, but it always
fails
quoted
at the same
quoted
quoted
quoted
point (or close to that). More recent
test
quoted
showed that I
quoted
quoted
quoted
could copy a few more files to the
filesystem
quoted
to a different
quoted
quoted
quoted
directory, but it very quickly failed
there
quoted
as well (a few
quoted
quoted
quoted
megabytes later).
quoted
After talking to the btrfs devs on
freenode (as btrfs
quoted
quoted
quoted
is the most experimental thing in the
stack,
quoted
they came to
quoted
quoted
quoted
the conclusion that it's most probably
the
quoted
crypto layer.
quoted
quoted
quoted
quoted
Some details:
gentoo kernel 3.2.1 (custom config
and
quoted
ubuntu config)
quoted
quoted
quoted
quoted
mdraid: linear, 4 disks, each 2TB
(total
quoted
8TB)
quoted
quoted
quoted
quoted
crypt: setup via cryptsetup -c
aes-xts-plain64 -h plain
quoted
quoted
quoted
-s 512 -d - create tempraid
/dev/md/tempraid_lin
quoted
quoted
quoted
quoted
I'd appreciate any help with this
and
quoted
would be happy to
quoted
quoted
quoted
test patches or provide more debug
info.
quoted
quoted
quoted
quoted
quoted
Thanks and Regards,
Luzipher




The kernel bug output retrieved by
netconsole (also at
quoted
quoted
quoted
http://pastebin.com/sjJy7QE4 ):
quoted
    [  294.538422]
netconsole:
quoted
quoted
quoted
quoted
local port 6666
quoted
    [  333.423583] SysRq :
Changing Loglevel
quoted
    [  333.423609] Loglevel
set to 9
quoted
    [  424.248405]
------------[ cut here ]------------
quoted
    [  424.248447] kernel BUG
at fs/bio.c:1499!

Hi Luzipher,

Looks like the BUG is because bio_split
only
quoted
works on
quoted
quoted
quoted
single-page iovecs.

I see a relevant (old) patch from Neil
Brown
quoted
here:
quoted
quoted
quoted
https://lkml.org/lkml/2007/7/30/496

Regards,
Mandeep
--
To unsubscribe from this list: send the line "unsubscribe
linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help