Skip to contentSkip to conversation

MD:Update superblock when err == 0 in size_store

PATCH Applied Xiao Ni 2 participants 2 messages Jun 12, 2016 – Jun 13, 2016 MD RAID

lore
Share & tools
lore

Xiao Ni

author
#0 lore raw

PATCH 1/1 MD:Update superblock when err == 0 in size_store

Hi

This is a simple check before updating the superblock. It should update the superblock when update_size return 0.

Regards
Xiao

---
 drivers/md/md.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/md/md.c +2 -1
index c068f17..0332a13 100644
@@ -4181,7 +4181,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)
Signature · 1 line
2.4.3
Applied
#1 lore raw
Quoted 4 lines · Xiao Ni

Hi

This is a simple check before updating the superblock. It should update the superblock when update_size return 0.

Applied, thanks!