There is another valid test when we take the lock, the previous test can be dropped. Signed-off-by: Mikulas Patocka --- drivers/md/dm-snap.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) Index: linux-2.6.25.3/drivers/md/dm-snap.c =================================================================== --- linux-2.6.25.3.orig/drivers/md/dm-snap.c 2008-05-23 21:05:15.000000000 +0200 +++ linux-2.6.25.3/drivers/md/dm-snap.c 2008-05-23 21:05:21.000000000 +0200 @@ -960,15 +960,11 @@ static int snapshot_map(struct dm_target chunk = sector_to_chunk(s, bio->bi_sector); - /* Full snapshots are not usable */ - /* To get here the table must be live so s->active is always set. */ - if (!s->valid) - return -EIO; - /* FIXME: should only take write lock if we need * to copy an exception */ down_write(&s->lock); + /* Full snapshots are not usable */ if (!s->valid) { r = -EIO; goto out_unlock;