From 4d4471cb5c1ec426c0f24818b270dc7b3ad7e655 Mon Sep 17 00:00:00 2001 From: Kiyoshi Ueda Date: Thu, 10 Dec 2009 23:52:26 +0000 Subject: [RHEL5.7 PATCH] dm: swap target postsuspend call and setting suspended flag Upstream commit 4d4471cb5c1ec426c0f24818b270dc7b3ad7e655 Author: Kiyoshi Ueda Date: Thu Dec 10 23:52:26 2009 +0000 dm: swap target postsuspend call and setting suspended flag This patch moves DMF_SUSPENDED flag set before postsuspend. No one should care about the ordering, because the flag set and the postsuspend are protected by a single lock, md->suspend_lock, and all strict flag-checkers take the lock. Signed-off-by: Kiyoshi Ueda Signed-off-by: Jun'ichi Nomura Cc: Mike Anderson Signed-off-by: Alasdair G Kergon --- drivers/md/dm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) Index: linux-rhel5/drivers/md/dm.c =================================================================== --- linux-rhel5.orig/drivers/md/dm.c +++ linux-rhel5/drivers/md/dm.c @@ -1491,10 +1491,10 @@ int dm_suspend(struct mapped_device *md, } up_write(&md->io_lock); - dm_table_postsuspend_targets(map); - set_bit(DMF_SUSPENDED, &md->flags); + dm_table_postsuspend_targets(map); + r = 0; flush_and_out: