@@ -1325,6 +1325,7 @@ static int snapshot_preresume(struct dm_target *ti)
up_write(&snap_src->lock);
goto normal_snapshot;
}
+ up_write(&snap_src->lock);
if (s == snap_src) {
/* handover source must not resume before destination */
DMERR("Unable to handover exceptions on "
@@ -1334,13 +1335,12 @@ static int snapshot_preresume(struct dm_target *ti)
r = -EINVAL;
} else {
/* if handover-destination, source must be suspended */
- if (!snap_src->suspended) {
+ if (!dm_table_md_suspended(snap_src->ti->table)) {
DMERR("Unable to accept exceptions from a "
"snapshot that is not suspended.");
r = -EINVAL;
}
}
- up_write(&snap_src->lock);
}
normal_snapshot: