[Buildd-tools-devel] Bug#471545: Bug#471545: schroot: Access out of device boundaries in lvm snapshots

Stephan Suerken absurd at olurdix.de
Tue Apr 1 17:08:23 UTC 2008


On Thu, 2008-03-20 at 12:48 +0100, Stephan Suerken wrote: 
> On Wed, 2008-03-19 at 00:12 +0000, Roger Leigh wrote:
> > Stephan A Suerken <absurd at debian.org> writes:
> > 
> > > using schroot in sid (or etch), it is easy to create a configuration
> > > that writes out of device boundaries (while I guess the real problem is
> > > in device mapper); on a 2.6.24 system, it freezed the whole system (no
> > > logs available ;), on other kernels (my also depend on lvm setup;) it
> > > "only" corrupts the fs.

Ok, for the record, this is how to reproduce leaving out schroot and fs,
just using lvm commands.

!! Before testing this, please NOTE that (at least when having fs mounted
!! on the snap) this in some cases resulted in hilarious kernel failures,
!! including complete system halt (this was under a 2.6.24 kernel).

Assuming you have some vg (just "vg" below), big enough, ready.

# lvcreate -n base --size 8M vg
# lvcreate -s -n snap --size 4M /dev/vg/base
# cat /dev/zero >/dev/vg/snap

In kern.log, you will get something like this (here 2.6.22-4-k7, also
"working" with etch-standard kernel 2.6.18):
---
Apr  1 18:51:59 manwe kernel: device-mapper: snapshots: Invalidating snapshot: Unable to allocate exception.
Apr  1 18:52:00 manwe kernel: Buffer I/O error on device dm-6, logical block 1020
Apr  1 18:52:00 manwe kernel: lost page write due to I/O error on dm-6
Apr  1 18:52:00 manwe kernel: Buffer I/O error on device dm-6, logical block 1021
Apr  1 18:52:00 manwe kernel: lost page write due to I/O error on dm-6
Apr  1 18:52:00 manwe kernel: Buffer I/O error on device dm-6, logical block 1022
Apr  1 18:52:00 manwe kernel: lost page write due to I/O error on dm-6
Apr  1 18:52:00 manwe kernel: Buffer I/O error on device dm-6, logical block 1023
Apr  1 18:52:00 manwe kernel: lost page write due to I/O error on dm-6
Apr  1 18:52:00 manwe kernel: Buffer I/O error on device dm-6, logical block 1024
Apr  1 18:52:00 manwe kernel: lost page write due to I/O error on dm-6
Apr  1 18:52:00 manwe kernel: Buffer I/O error on device dm-6, logical block 1025
Apr  1 18:52:00 manwe kernel: lost page write due to I/O error on dm-6
Apr  1 18:52:00 manwe kernel: Buffer I/O error on device dm-6, logical block 1026
Apr  1 18:52:00 manwe kernel: lost page write due to I/O error on dm-6
Apr  1 18:52:00 manwe kernel: Buffer I/O error on device dm-6, logical block 1027
Apr  1 18:52:00 manwe kernel: lost page write due to I/O error on dm-6
Apr  1 18:52:00 manwe kernel: Buffer I/O error on device dm-6, logical block 1028
Apr  1 18:52:00 manwe kernel: lost page write due to I/O error on dm-6
Apr  1 18:52:00 manwe kernel: Buffer I/O error on device dm-6, logical block 1029
Apr  1 18:52:00 manwe kernel: lost page write due to I/O error on dm-6
---

As far as I can see, this (i.e., creating a snap < base) should either
be forbidden in lvcreate and/or dm/kernel if it isn't assumed to work.
If this is assumed to work, it seems to be a dm/kernel bug.

I hope the lvm maintainers can answer these...

Thanks,

Stephan
-- 
Stephan A Suerken <absurd at olurdix.de>






More information about the Buildd-tools-devel mailing list