Does it means if some one use write-intent bitmap without this patch, he may end-up with some unsync stripes after system crash or power failure and RAID resynchronization ? It seems the bitmaps does not record correct address of unsynced blocks due to this bug. Would you please verify this. On Tue, Mar 24, 2015 at 9:15 PM, NeilBrown <neilb@xxxxxxx> wrote: > On Tue, 24 Mar 2015 11:29:05 -0500 Goldwyn Rodrigues <rgoldwyn@xxxxxxx> wrote: > >> The calculations of bitmap offset is incorrect with respect to bits to bytes >> conversion. >> >> Also, remove an irrelevant duplicate message. >> >> Signed-off-by: Goldwyn Rodrigues <rgoldwyn@xxxxxxxx> >> --- >> diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c >> index ac79fef..e98db04 100644 >> --- a/drivers/md/bitmap.c >> +++ b/drivers/md/bitmap.c >> @@ -575,7 +575,9 @@ re_read: >> >> sector_div(bm_blocks, >> bitmap->mddev->bitmap_info.chunksize >> 9); >> - bm_blocks = bm_blocks << 3; >> + /* bits to bytes */ >> + bm_blocks = ((bm_blocks+7) >> 3) + sizeof(bitmap_super_t); >> + /* to 4k blocks */ >> bm_blocks = DIV_ROUND_UP_SECTOR_T(bm_blocks, 4096); >> bitmap->mddev->bitmap_info.offset += bitmap->cluster_slot * (bm_blocks << 3); >> pr_info("%s:%d bm slot: %d offset: %llu\n", __func__, __LINE__, >> @@ -672,9 +674,6 @@ out: >> goto out_no_sb; >> } >> bitmap->cluster_slot = md_cluster_ops->slot_number(bitmap->mddev); >> - pr_info("%s:%d bm slot: %d offset: %llu\n", __func__, __LINE__, >> - bitmap->cluster_slot, >> - (unsigned long long)bitmap->mddev->bitmap_info.offset); >> goto re_read; >> } >> > > Applied, thanks. > > NeilBrown -- To unsubscribe from this list: send the line "unsubscribe linux-raid" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html