diff options
-rw-r--r-- | drivers/md/dm-snap.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/md/dm-snap.c b/drivers/md/dm-snap.c index 3a3ba46e6d4b..d135212958f1 100644 --- a/drivers/md/dm-snap.c +++ b/drivers/md/dm-snap.c | |||
@@ -1152,10 +1152,11 @@ static int snapshot_status(struct dm_target *ti, status_type_t type, | |||
1152 | unsigned sz = 0; | 1152 | unsigned sz = 0; |
1153 | struct dm_snapshot *snap = ti->private; | 1153 | struct dm_snapshot *snap = ti->private; |
1154 | 1154 | ||
1155 | down_write(&snap->lock); | ||
1156 | |||
1157 | switch (type) { | 1155 | switch (type) { |
1158 | case STATUSTYPE_INFO: | 1156 | case STATUSTYPE_INFO: |
1157 | |||
1158 | down_write(&snap->lock); | ||
1159 | |||
1159 | if (!snap->valid) | 1160 | if (!snap->valid) |
1160 | DMEMIT("Invalid"); | 1161 | DMEMIT("Invalid"); |
1161 | else { | 1162 | else { |
@@ -1171,6 +1172,9 @@ static int snapshot_status(struct dm_target *ti, status_type_t type, | |||
1171 | else | 1172 | else |
1172 | DMEMIT("Unknown"); | 1173 | DMEMIT("Unknown"); |
1173 | } | 1174 | } |
1175 | |||
1176 | up_write(&snap->lock); | ||
1177 | |||
1174 | break; | 1178 | break; |
1175 | 1179 | ||
1176 | case STATUSTYPE_TABLE: | 1180 | case STATUSTYPE_TABLE: |
@@ -1185,8 +1189,6 @@ static int snapshot_status(struct dm_target *ti, status_type_t type, | |||
1185 | break; | 1189 | break; |
1186 | } | 1190 | } |
1187 | 1191 | ||
1188 | up_write(&snap->lock); | ||
1189 | |||
1190 | return 0; | 1192 | return 0; |
1191 | } | 1193 | } |
1192 | 1194 | ||