Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d287483d authored by Alasdair G Kergon's avatar Alasdair G Kergon Committed by Linus Torvalds
Browse files

[PATCH] dm: suspend: fix error path



If the device is already suspended, just return the error and skip the code
that would incorrectly wipe md->suspended_bdev.

(This isn't currently a problem because existing code avoids calling this
function if the device is already suspended.)

Signed-off-by: default avatarAlasdair G Kergon <agk@redhat.com>
Cc: <dm-devel@redhat.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent bfc5ecdf
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -1285,7 +1285,7 @@ int dm_suspend(struct mapped_device *md, int do_lockfs)
	down(&md->suspend_lock);

	if (dm_suspended(md))
		goto out;
		goto out_unlock;

	map = dm_get_table(md);

@@ -1361,6 +1361,8 @@ out:
	}

	dm_table_put(map);

out_unlock:
	up(&md->suspend_lock);
	return r;
}