]> git.baikalelectronics.ru Git - kernel.git/commit
dm snapshot: fix on disk chunk size validation
authorMikulas Patocka <mpatocka@redhat.com>
Fri, 4 Sep 2009 19:40:43 +0000 (20:40 +0100)
committerAlasdair G Kergon <agk@redhat.com>
Fri, 4 Sep 2009 19:40:43 +0000 (20:40 +0100)
commit8b8e062567712962726efa8d9e3faf7f39f2473d
treea5c5d0532c808fb1eb2c01414edfcd2d0c039a7e
parent22b6172f0badfc432059fc85a29f5c1f73efa46a
dm snapshot: fix on disk chunk size validation

Fix some problems seen in the chunk size processing when activating a
pre-existing snapshot.

For a new snapshot, the chunk size can either be supplied by the creator
or a default value can be used.  For an existing snapshot, the
chunk size in the snapshot header on disk should always be used.

If someone attempts to load an existing snapshot and has the 'default
chunk size' option set, the kernel uses its default value even when it
is incorrect for the snapshot being loaded.  This patch ensures the
correct on-disk value is always used.

Secondly, when the code does use the chunk size stored on the disk it is
prudent to revalidate it, so the code can exit cleanly if it got
corrupted as happened in
https://bugzilla.redhat.com/show_bug.cgi?id=461506 .

Cc: stable@kernel.org
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
drivers/md/dm-exception-store.c
drivers/md/dm-snap-persistent.c