Re: [PATCH 1/7] md: add a missing endianess conversion in check_sb_changes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On 4/5/19 12:56 AM, Christoph Hellwig wrote:
The on-disk value is little endian and we need to convert it to
native endian before storing the value in the in-core structure.

Thanks for the catch, It's better to have
Fixes: 7564beda19b36 ("md-cluster/raid10: support add disk under grow mode")

Signed-off-by: Christoph Hellwig <hch@xxxxxx>
---
  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 d0f688399a56..18acfd79fb0b 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -9227,7 +9227,7 @@ static void check_sb_changes(struct mddev *mddev, struct md_rdev *rdev)
  		 * reshape is happening in the remote node, we need to
  		 * update reshape_position and call start_reshape.
  		 */
-		mddev->reshape_position = sb->reshape_position;
+		mddev->reshape_position = le64_to_cpu(sb->reshape_position);
  		if (mddev->pers->update_reshape_pos)
  			mddev->pers->update_reshape_pos(mddev);
  		if (mddev->pers->start_reshape)

Acked-by: Guoqing Jiang <gqjiang@xxxxxxxx>

Regards,
Guoqing



[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux