提交 cbe6ef1d 编写于 作者: N NeilBrown

md: don't set_capacity before array is active.

If the desired size of an array is set (via sysfs) before the array is
active (which is the normal sequence), we currrently call set_capacity
immediately.
This means that a subsequent 'open' (as can be caused by some
udev-triggers program) will notice the new size and try to probe for
partitions.  However as the array isn't quite ready yet the read will
fail.  Then when the array is read, as the size doesn't change again
we don't try to re-probe.

So when setting array size via sysfs, only call set_capacity if the
array is already active.
Signed-off-by: NNeilBrown <neilb@suse.de>
上级 f7bee809
...@@ -4138,10 +4138,10 @@ array_size_store(mddev_t *mddev, const char *buf, size_t len) ...@@ -4138,10 +4138,10 @@ array_size_store(mddev_t *mddev, const char *buf, size_t len)
} }
mddev->array_sectors = sectors; mddev->array_sectors = sectors;
if (mddev->pers) {
set_capacity(mddev->gendisk, mddev->array_sectors); set_capacity(mddev->gendisk, mddev->array_sectors);
if (mddev->pers)
revalidate_disk(mddev->gendisk); revalidate_disk(mddev->gendisk);
}
return len; return len;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册