From: Jason Yan Date: Fri, 10 Mar 2017 03:49:12 +0000 (+0800) Subject: md: fix incorrect use of lexx_to_cpu in does_sb_need_changing X-Git-Tag: release-20171130_firefly~4^2~100^2^2^2~8 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=e20894aad9e875e4aec2c73e7badcd440f02cde4;p=firefly-linux-kernel-4.4.55.git md: fix incorrect use of lexx_to_cpu in does_sb_need_changing commit 1345921393ba23b60d3fcf15933e699232ad25ae upstream. The sb->layout is of type __le32, so we shoud use le32_to_cpu. Signed-off-by: Jason Yan Signed-off-by: Shaohua Li Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/md/md.c b/drivers/md/md.c index eff554a12fb4..060a79a7ef4e 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -2273,7 +2273,7 @@ static bool does_sb_need_changing(struct mddev *mddev) /* Check if any mddev parameters have changed */ if ((mddev->dev_sectors != le64_to_cpu(sb->size)) || (mddev->reshape_position != le64_to_cpu(sb->reshape_position)) || - (mddev->layout != le64_to_cpu(sb->layout)) || + (mddev->layout != le32_to_cpu(sb->layout)) || (mddev->raid_disks != le32_to_cpu(sb->raid_disks)) || (mddev->chunk_sectors != le32_to_cpu(sb->chunksize))) return true;