md: fix incorrect use of lexx_to_cpu in does_sb_need_changing
authorJason Yan <yanaijie@huawei.com>
Fri, 10 Mar 2017 03:49:12 +0000 (11:49 +0800)
committerShaohua Li <shli@fb.com>
Fri, 10 Mar 2017 20:54:38 +0000 (12:54 -0800)
The sb->layout is of type __le32, so we shoud use le32_to_cpu.

Signed-off-by: Jason Yan <yanaijie@huawei.com>
Signed-off-by: Shaohua Li <shli@fb.com>
drivers/md/md.c

index 6e76d97a8fc38be422cea7e3571be3bc90cd7b52..f6ae1d67bcd02c6b743258ef3ff6a05896828cb5 100644 (file)
@@ -2287,7 +2287,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;