From: Minfei Huang Date: Tue, 6 Sep 2016 08:00:29 +0000 (+0800) Subject: dm: return correct error code in dm_resume()'s retry loop X-Git-Tag: firefly_0821_release~176^2~4^2~22^2~89 X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=bf74a108c67947a2c72d16786338b89d75119a48;p=firefly-linux-kernel-4.4.55.git dm: return correct error code in dm_resume()'s retry loop commit 8dc23658b7aaa8b6b0609c81c8ad75e98b612801 upstream. dm_resume() will return success (0) rather than -EINVAL if !dm_suspended_md() upon retry within dm_resume(). Reset the error code at the start of dm_resume()'s retry loop. Also, remove a useless assignment at the end of dm_resume(). Fixes: ffcc393641 ("dm: enhance internal suspend and resume interface") Signed-off-by: Minfei Huang Signed-off-by: Mike Snitzer Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/md/dm.c b/drivers/md/dm.c index 0efc3d60e6b7..84aa8b1d0480 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c @@ -3250,10 +3250,11 @@ static int __dm_resume(struct mapped_device *md, struct dm_table *map) int dm_resume(struct mapped_device *md) { - int r = -EINVAL; + int r; struct dm_table *map = NULL; retry: + r = -EINVAL; mutex_lock_nested(&md->suspend_lock, SINGLE_DEPTH_NESTING); if (!dm_suspended_md(md)) @@ -3277,8 +3278,6 @@ retry: goto out; clear_bit(DMF_SUSPENDED, &md->flags); - - r = 0; out: mutex_unlock(&md->suspend_lock);