]> git.itanic.dy.fi Git - linux-stable/commit
dm snapshot: unify chunk_size
authorAlasdair G Kergon <agk@redhat.com>
Thu, 14 Dec 2006 22:04:35 +0000 (23:04 +0100)
committerAdrian Bunk <bunk@stusta.de>
Thu, 14 Dec 2006 22:04:35 +0000 (23:04 +0100)
commit9d1b6de8ff144beea7408c6d2ca387e2a7bf76ef
tree9ca5580a82d68117708d9ec8f035ee8a9c17de52
parent9f822c56ba441b14abbc9e3060bc11e69ce3b721
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 chun
size was supplied, the 'area' buffer (which the header already got read into
is reinitialised to the correct size.

Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
drivers/md/dm-exception-store.c
drivers/md/dm-snap.c