Skip to content

Commit

Permalink
[PATCH] dm: suspend: fix error path
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Alasdair G Kergon authored and Linus Torvalds committed Nov 9, 2006
1 parent bfc5ecd commit d287483
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/md/dm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -1361,6 +1361,8 @@ int dm_suspend(struct mapped_device *md, int do_lockfs)
}

dm_table_put(map);

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

0 comments on commit d287483

Please sign in to comment.