Linux RAID subsystem development
 help / color / mirror / Atom feed
* [PATCH] md: fix super_offset endianness in super_1_rdev_size_change
@ 2017-03-10  3:27 Jason Yan
  2017-03-10  4:47 ` Shaohua Li
  0 siblings, 1 reply; 2+ messages in thread
From: Jason Yan @ 2017-03-10  3:27 UTC (permalink / raw)
  To: shli, linux-raid; +Cc: miaoxie, zhaohongjiang, Jason Yan

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>
---
 drivers/md/md.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/md/md.c b/drivers/md/md.c
index 548d1b8..b6516f8 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -1887,7 +1887,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,
-- 
2.5.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-03-10  4:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-10  3:27 [PATCH] md: fix super_offset endianness in super_1_rdev_size_change Jason Yan
2017-03-10  4:47 ` Shaohua Li

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox