]> git.karo-electronics.de Git - karo-tx-linux.git/commit
dm snapshot: unify chunk_size
authorAlasdair G Kergon <agk@redhat.com>
Mon, 26 Jun 2006 07:27:18 +0000 (00:27 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 8 Sep 2006 21:51:37 +0000 (14:51 -0700)
commit208b2761fe4610452ac076630e241a95dcf79725
treeb75a015c0f203729361255ef5cfaaa0cd7cc844c
parent2336231e06979e7073132c22b121c34123f295a6
dm snapshot: unify chunk_size

Persistent snapshots currently store a private copy of the chunk size.
Userspace also supplies the chunk size when loading a snapshot.  Ensure
consistency by only storing the chunk_size in one place instead of two.

Currently the two sizes will differ if the chunk size supplied by userspace
does not match the chunk size an existing snapshot actually uses.  Amongst
other problems, this causes an incorrect 'percentage full' to be reported.

The patch ensures consistency by only storing the chunk_size in one place,
removing it from struct pstore.  Some initialisation is delayed until the
correct chunk_size is known.  If read_header() discovers that the wrong chunk
size was supplied, the 'area' buffer (which the header already got read into)
is reinitialised to the correct size.

[akpm: too late for 2.6.17 - suitable for 2.6.17.x after it has settled]

Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/md/dm-exception-store.c
drivers/md/dm-snap.c