]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
md: add a missing endianness conversion in check_sb_changes
authorChristoph Hellwig <hch@lst.de>
Thu, 4 Apr 2019 16:56:10 +0000 (18:56 +0200)
committerSong Liu <songliubraving@fb.com>
Wed, 10 Apr 2019 22:26:08 +0000 (15:26 -0700)
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.

Fixes: 7564beda19b36 ("md-cluster/raid10: support add disk under grow mode")
Cc: <stable@vger.kernel.org> # 4.20+
Acked-by: Guoqing Jiang <gqjiang@suse.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Song Liu <songliubraving@fb.com>
drivers/md/md.c

index 664b77ceaf2d9c886f98add203d878b25e6d1ce4..a15eb7e37c6d2266e13f8177a35113912a5f7c95 100644 (file)
@@ -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)