md: fix super_offset endianness in super_1_rdev_size_change
authorJason Yan <yanaijie@huawei.com>
Fri, 10 Mar 2017 03:27:23 +0000 (11:27 +0800)
committerShaohua Li <shli@fb.com>
Fri, 10 Mar 2017 20:54:37 +0000 (12:54 -0800)
The sb->super_offset should be big-endian, but the rdev->sb_start is in
host byte order, so fix this by adding cpu_to_le64.

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

index cd89ad3c3a0d2c4f47fedd12f9f4f47b0247cc25..6e76d97a8fc38be422cea7e3571be3bc90cd7b52 100644 (file)
@@ -1879,7 +1879,7 @@ super_1_rdev_size_change(struct md_rdev *rdev, sector_t num_sectors)
        }
        sb = page_address(rdev->sb_page);
        sb->data_size = cpu_to_le64(num_sectors);
-       sb->super_offset = rdev->sb_start;
+       sb->super_offset = cpu_to_le64(rdev->sb_start);
        sb->sb_csum = calc_sb_1_csum(sb);
        do {
                md_super_write(rdev->mddev, rdev, rdev->sb_start, rdev->sb_size,