• Yufen Yu's avatar
    md/raid5: make sure stripe_size as power of two · 6af10a33
    Yufen Yu authored
    Commit 3b5408b9 ("md/raid5: support config stripe_size by sysfs
    entry") make stripe_size as a configurable value. It just requires
    stripe_size as multiple of 4KB.
    
    In fact, we should make sure stripe_size as power of two. Otherwise,
    stripe_shift which is the result of ilog2 can not represent the real
    stripe_size. Then, stripe_hash() and stripe_hash_locks_hash() may
    get unexpected value.
    
    Fixes: 3b5408b9 ("md/raid5: support config stripe_size by sysfs entry")
    Signed-off-by: default avatarYufen Yu <yuyufen@huawei.com>
    Signed-off-by: default avatarSong Liu <songliubraving@fb.com>
    6af10a33
raid5.c 243 KB