summaryrefslogtreecommitdiff
path: root/drivers/md/md.h
diff options
context:
space:
mode:
authorHeinz Mauelshagen <heinzm@redhat.com>2018-02-03 01:13:19 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-05-30 08:51:57 +0300
commite08f866978350ecc9dd90a2cfeb907b2abb74392 (patch)
treedb0c142fff3e6362cb68d92ec8bf0ad7ce4816e9 /drivers/md/md.h
parentca4363bf7cb882aa725762bdfa2e1e87ac431e2f (diff)
downloadlinux-e08f866978350ecc9dd90a2cfeb907b2abb74392.tar.xz
md: fix md_write_start() deadlock w/o metadata devices
[ Upstream commit 4b6c1060eaa6495aa5b0032e8f2d51dd936b1257 ] If no metadata devices are configured on raid1/4/5/6/10 (e.g. via dm-raid), md_write_start() unconditionally waits for superblocks to be written thus deadlocking. Fix introduces mddev->has_superblocks bool, defines it in md_run() and checks for it in md_write_start() to conditionally avoid waiting. Once on it, check for non-existing superblocks in md_super_write(). Link: https://bugzilla.kernel.org/show_bug.cgi?id=198647 Fixes: cc27b0c78c796 ("md: fix deadlock between mddev_suspend() and md_write_start()") Signed-off-by: Heinz Mauelshagen <heinzm@redhat.com> Signed-off-by: Shaohua Li <sh.li@alibaba-inc.com> Signed-off-by: Sasha Levin <alexander.levin@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/md/md.h')
-rw-r--r--drivers/md/md.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/md/md.h b/drivers/md/md.h
index d8287d3cd1bf..9b0a896890ef 100644
--- a/drivers/md/md.h
+++ b/drivers/md/md.h
@@ -462,6 +462,8 @@ struct mddev {
void (*sync_super)(struct mddev *mddev, struct md_rdev *rdev);
struct md_cluster_info *cluster_info;
unsigned int good_device_nr; /* good device num within cluster raid */
+
+ bool has_superblocks:1;
};
enum recovery_flags {