From 4ba1e78891e9858a5c773e6ffe4414611019bf42 Mon Sep 17 00:00:00 2001 From: Xiao Ni Date: Sun, 12 Jun 2016 17:18:00 +0800 Subject: MD:Update superblock when err == 0 in size_store This is a simple check before updating the superblock. It should update the superblock when update_size return 0. Signed-off-by: Xiao Ni Signed-off-by: Shaohua Li --- drivers/md/md.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'drivers/md') diff --git a/drivers/md/md.c b/drivers/md/md.c index 43728a4..d0c1e79 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -4186,7 +4186,8 @@ size_store(struct mddev *mddev, const char *buf, size_t len) return err; if (mddev->pers) { err = update_size(mddev, sectors); - md_update_sb(mddev, 1); + if (err == 0) + md_update_sb(mddev, 1); } else { if (mddev->dev_sectors == 0 || mddev->dev_sectors > sectors) -- cgit v1.1