diff options
author | Alasdair G Kergon <agk@redhat.com> | 2006-11-09 02:44:43 +0100 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-11-09 03:29:23 +0100 |
commit | d287483d6d7a2d5b313aee155285f89b57d9cd4a (patch) | |
tree | 63c0a47618b9efb465c6abb584a93214e0850485 /drivers | |
parent | [PATCH] dm: fix find_device race (diff) | |
download | linux-d287483d6d7a2d5b313aee155285f89b57d9cd4a.tar.xz linux-d287483d6d7a2d5b313aee155285f89b57d9cd4a.zip |
[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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/md/dm.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/md/dm.c b/drivers/md/dm.c index b5764a86c8b5..fc4f743f3b53 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c @@ -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; } |