2.6.31-stable review patch. If anyone has any objections, please let us know. ------------------ From: Mikulas Patocka 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 Signed-off-by: Alasdair G Kergon Signed-off-by: Greg Kroah-Hartman --- drivers/md/dm-snap.c | 4 ++++ 1 file changed, 4 insertions(+) --- a/drivers/md/dm-snap.c +++ b/drivers/md/dm-snap.c @@ -1147,6 +1147,8 @@ static int snapshot_status(struct dm_tar unsigned sz = 0; struct dm_snapshot *snap = ti->private; + down_write(&snap->lock); + switch (type) { case STATUSTYPE_INFO: if (!snap->valid) @@ -1178,6 +1180,8 @@ static int snapshot_status(struct dm_tar break; } + up_write(&snap->lock); + return 0; } -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/