dm snapshot: lock snapshot while supplying status
commit651385e4bbbff823f111e4e8a68b2e1613c34c79
authorMikulas Patocka <mpatocka@redhat.com>
Fri, 16 Oct 2009 22:18:16 +0000 (16 23:18 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 10 Nov 2009 00:22:06 +0000 (9 16:22 -0800)
treefb4b3ed8702f2a78754c4f58e6174e9f6f13eb38
parente61f48eb0ac00c6d73dd53b3d79abe2c578328dc
dm snapshot: lock snapshot while supplying status

commit 4c6fff445d7aa753957856278d4d93bcad6e2c14 upstream.

This patch locks the snapshot when returning status.  It fixes a race
when it could return an invalid number of free chunks if someone
was simultaneously modifying it.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/md/dm-snap.c