Skip to content
Commit 3cb5edf4 authored by NeilBrown's avatar NeilBrown
Browse files

md/raid5: switch to use conf->chunk_sectors in place of mddev->chunk_sectors where possible



The chunk_sectors and new_chunk_sectors fields of mddev can be changed
any time (via sysfs) that the reconfig mutex can be taken.  So raid5
keeps internal copies in 'conf' which are stable except for a short
locked moment when reshape stops/starts.

So any access that does not hold reconfig_mutex should use the 'conf'
values, not the 'mddev' values.
Several don't.

This could result in corruption if new values were written at awkward
times.

Also use min() or max() rather than open-coding.

Signed-off-by: default avatarNeilBrown <neilb@suse.com>
parent 5cac6bcb
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment