|
@@ -1152,10 +1152,11 @@ static int snapshot_status(struct dm_target *ti, status_type_t type,
|
|
unsigned sz = 0;
|
|
unsigned sz = 0;
|
|
struct dm_snapshot *snap = ti->private;
|
|
struct dm_snapshot *snap = ti->private;
|
|
|
|
|
|
- down_write(&snap->lock);
|
|
|
|
-
|
|
|
|
switch (type) {
|
|
switch (type) {
|
|
case STATUSTYPE_INFO:
|
|
case STATUSTYPE_INFO:
|
|
|
|
+
|
|
|
|
+ down_write(&snap->lock);
|
|
|
|
+
|
|
if (!snap->valid)
|
|
if (!snap->valid)
|
|
DMEMIT("Invalid");
|
|
DMEMIT("Invalid");
|
|
else {
|
|
else {
|
|
@@ -1171,6 +1172,9 @@ static int snapshot_status(struct dm_target *ti, status_type_t type,
|
|
else
|
|
else
|
|
DMEMIT("Unknown");
|
|
DMEMIT("Unknown");
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ up_write(&snap->lock);
|
|
|
|
+
|
|
break;
|
|
break;
|
|
|
|
|
|
case STATUSTYPE_TABLE:
|
|
case STATUSTYPE_TABLE:
|
|
@@ -1185,8 +1189,6 @@ static int snapshot_status(struct dm_target *ti, status_type_t type,
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
|
|
|
|
- up_write(&snap->lock);
|
|
|
|
-
|
|
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|