From: Milan Broz <mbroz@redhat.com> Subject: [RHEL 5.1 PATCH] dm: fix suspend error path Date: Thu, 10 May 2007 12:00:52 +0200 Bugzilla: 239645 Message-Id: <4642ED54.2080900@redhat.com> Changelog: [md] dm: fix suspend error path RHEL5.1 device mapper: fix suspend error path Resolves: rhbz#239645 Patch is upstream and in RHEL4.5. If the device is already suspended, just return the error and skip the code that would incorrectly wipe md->suspended_bdev. Kernel with fix compiled and tested with basic suspend/resume tests. --- drivers/md/dm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) Index: linux-2.6.18/drivers/md/dm.c =================================================================== --- linux-2.6.18.orig/drivers/md/dm.c 2007-05-09 10:19:42.000000000 +0200 +++ linux-2.6.18/drivers/md/dm.c 2007-05-10 11:01:52.000000000 +0200 @@ -1333,7 +1333,7 @@ int dm_suspend(struct mapped_device *md, down(&md->suspend_lock); if (dm_suspended(md)) - goto out; + goto out_unlock; map = dm_get_table(md); @@ -1449,6 +1449,8 @@ out: } dm_table_put(map); + +out_unlock: up(&md->suspend_lock); return r; }