[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: Alasdair G Kergon <agk@redhat.com>
Cc: <dm-devel@redhat.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
Alasdair G Kergon 2006-11-08 17:44:43 -08:00 committed by Linus Torvalds
parent bfc5ecdf48
commit d287483d6d
1 changed files with 3 additions and 1 deletions

View File

@ -1285,7 +1285,7 @@ int dm_suspend(struct mapped_device *md, int do_lockfs)
down(&md->suspend_lock); down(&md->suspend_lock);
if (dm_suspended(md)) if (dm_suspended(md))
goto out; goto out_unlock;
map = dm_get_table(md); map = dm_get_table(md);
@ -1361,6 +1361,8 @@ int dm_suspend(struct mapped_device *md, int do_lockfs)
} }
dm_table_put(map); dm_table_put(map);
out_unlock:
up(&md->suspend_lock); up(&md->suspend_lock);
return r; return r;
} }