MD:Update superblock when err == 0 in size_store
authorXiao Ni <xni@redhat.com>
Sun, 12 Jun 2016 09:18:00 +0000 (17:18 +0800)
committerShaohua Li <shli@fb.com>
Mon, 13 Jun 2016 18:54:11 +0000 (11:54 -0700)
This is a simple check before updating the superblock. It should update
the superblock when update_size return 0.

Signed-off-by: Xiao Ni <xni@redhat.com>
Signed-off-by: Shaohua Li <shli@fb.com>
drivers/md/md.c

index 43728a4..d0c1e79 100644 (file)
@@ -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)