Re: [PATCH 2/6] md: Fix a bug in super_1_sync().
From: Andre Noll <hidden>
Date: 2009-05-25 13:40:46
Attachments
- signature.asc [application/pgp-signature] 189 bytes
From: Andre Noll <hidden>
Date: 2009-05-25 13:40:46
On 19:49, NeilBrown wrote:
quoted
diff --git a/drivers/md/md.c b/drivers/md/md.c index 48bdbdf..66e32e4 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c@@ -1402,7 +1402,7 @@ static void super_1_sync(mddev_t *mddev, mdk_rdev_t*rdev) sb->new_layout = cpu_to_le32(mddev->new_layout); sb->delta_disks = cpu_to_le32(mddev->delta_disks); sb->new_level = cpu_to_le32(mddev->new_level); - sb->new_chunk = cpu_to_le32(mddev->new_chunk>>9); + sb->new_chunk = cpu_to_le32(mddev->new_chunk);I think the current code is correct. For v1.x metadata, the chunk size (both chunksize and new_chunk) is stored in sectors. in 0.90 it is stored in bytes.
Oops you're right, I got confused by the comment in md_p.h that says new_chunk is in bytes, even for v1.x metadata. So please drop this second patch. Note that the corresponding hunk in the third patch needs to be changed as well: - sb->new_chunk = cpu_to_le32(mddev->new_chunk); + sb->new_chunk = cpu_to_le32(mddev->new_chunk_sectors << 9); must become - sb->new_chunk = cpu_to_le32(mddev->new_chunk>>9); + sb->new_chunk = cpu_to_le32(mddev->new_chunk_sectors); Thanks Andre -- The only person who always got his work done by Friday was Robinson Crusoe