diff --git a/[refs] b/[refs] index 7bf8e28ae04a..fdecfde3c06e 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: c3cd4f6b275da0f594797b73f721a4185335478f +refs/heads/master: 93c534aefb906824d71ea779ed0c7f1573843f4e diff --git a/trunk/drivers/md/dm.c b/trunk/drivers/md/dm.c index bb3ad79c14d7..54fabbf06678 100644 --- a/trunk/drivers/md/dm.c +++ b/trunk/drivers/md/dm.c @@ -966,23 +966,20 @@ static void __flush_deferred_io(struct mapped_device *md, struct bio *c) */ int dm_swap_table(struct mapped_device *md, struct dm_table *table) { - int r; + int r = -EINVAL; down_write(&md->lock); /* device must be suspended */ - if (!test_bit(DMF_SUSPENDED, &md->flags)) { - up_write(&md->lock); - return -EPERM; - } + if (!test_bit(DMF_SUSPENDED, &md->flags)) + goto out; __unbind(md); r = __bind(md, table); - if (r) - return r; +out: up_write(&md->lock); - return 0; + return r; } /*