The patch titled dm: mirror sector offset fix has been added to the -mm tree. Its filename is dm-mirror-sector-offset-fix.patch See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find out what to do about this ------------------------------------------------------ Subject: dm: mirror sector offset fix From: Neil Brown <neilb@xxxxxxx> The device-mapper core does not perform any remapping of bios before passing them to the targets. If a particular mapping begins part-way into a device, targets obtain the sector relative to the start of the mapping by subtracting ti->begin. The dm-raid1 target didn't do this everywhere: this patch fixes it, taking care to subtract ti->begin exactly once for each bio. [akpm: too late for 2.6.17 - suitable for 2.6.17.x after it has settled] Signed-off-by: Neil Brown <neilb@xxxxxxx> Signed-off-by: Alasdair G Kergon <agk@xxxxxxxxxx> Cc: <stable@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxx> --- drivers/md/dm-raid1.c | 63 ++++++++++++++++++++-------------------- 1 files changed, 32 insertions(+), 31 deletions(-) diff -puN drivers/md/dm-raid1.c~dm-mirror-sector-offset-fix drivers/md/dm-raid1.c --- devel/drivers/md/dm-raid1.c~dm-mirror-sector-offset-fix 2006-05-25 15:15:36.000000000 -0700 +++ devel-akpm/drivers/md/dm-raid1.c 2006-05-25 15:15:36.000000000 -0700 @@ -106,12 +106,42 @@ struct region { struct bio_list delayed_bios; }; + +/*----------------------------------------------------------------- + * Mirror set structures. + *---------------------------------------------------------------*/ +struct mirror { + atomic_t error_count; + struct dm_dev *dev; + sector_t offset; +}; + +struct mirror_set { + struct dm_target *ti; + struct list_head list; + struct region_hash rh; + struct kcopyd_client *kcopyd_client; + + spinlock_t lock; /* protects the next two lists */ + struct bio_list reads; + struct bio_list writes; + + /* recovery */ + region_t nr_regions; + int in_sync; + + struct mirror *default_mirror; /* Default mirror */ + + unsigned int nr_mirrors; + struct mirror mirror[0]; +}; + /* * Conversion fns */ static inline region_t bio_to_region(struct region_hash *rh, struct bio *bio) { - return bio->bi_sector >> rh->region_shift; + return (bio->bi_sector - rh->ms->ti->begin) >> rh->region_shift; } static inline sector_t region_to_sector(struct region_hash *rh, region_t region) @@ -539,35 +569,6 @@ static void rh_start_recovery(struct reg wake(); } -/*----------------------------------------------------------------- - * Mirror set structures. - *---------------------------------------------------------------*/ -struct mirror { - atomic_t error_count; - struct dm_dev *dev; - sector_t offset; -}; - -struct mirror_set { - struct dm_target *ti; - struct list_head list; - struct region_hash rh; - struct kcopyd_client *kcopyd_client; - - spinlock_t lock; /* protects the next two lists */ - struct bio_list reads; - struct bio_list writes; - - /* recovery */ - region_t nr_regions; - int in_sync; - - struct mirror *default_mirror; /* Default mirror */ - - unsigned int nr_mirrors; - struct mirror mirror[0]; -}; - /* * Every mirror should look like this one. */ @@ -1113,7 +1114,7 @@ static int mirror_map(struct dm_target * struct mirror *m; struct mirror_set *ms = ti->private; - map_context->ll = bio->bi_sector >> ms->rh.region_shift; + map_context->ll = bio_to_region(&ms->rh, bio); if (rw == WRITE) { queue_bio(ms, bio, rw); _ Patches currently in -mm which might be from neilb@xxxxxxx are fix-dcache-race-during-umount.patch prune_one_dentry-tweaks.patch remove-softlockup-from-invalidate_mapping_pages.patch prepare-for-__copy_from_user_inatomic-to-not-zero-missed-bytes.patch make-copy_from_user_inatomic-not-zero-the-tail-on-i386.patch kconfig-select-things-at-the-closest-tristate-instead-of-bool.patch readahead-nfsd-case.patch make-address_space_operations-invalidatepage-return-void-reiser4.patch dm-mirror-sector-offset-fix.patch md-reformat-code-in-raid1_end_write_request-to-avoid-goto.patch md-remove-arbitrary-limit-on-chunk-size.patch md-remove-useless-ioctl-warning.patch md-increase-the-delay-before-marking-metadata-clean-and-make-it-configurable.patch md-merge-raid5-and-raid6-code.patch md-remove-nuisance-message-at-shutdown.patch md-allow-checkpoint-of-recovery-with-version-1-superblock.patch md-allow-checkpoint-of-recovery-with-version-1-superblock-fix.patch md-allow-a-linear-array-to-have-drives-added-while-active.patch md-support-stripe-offset-mode-in-raid10.patch md-make-md_print_devices-static.patch md-split-reshape-portion-of-raid5-sync_request-into-a-separate-function.patch md-bitmap-fix-online-removal-of-file-backed-bitmaps.patch md-bitmap-remove-bitmap-writeback-daemon.patch md-bitmap-cleaner-separation-of-page-attribute-handlers-in-md-bitmap.patch md-bitmap-use-set_bit-etc-for-bitmap-page-attributes.patch md-bitmap-remove-unnecessary-page-reference-manipulations-from-md-bitmap-code.patch md-bitmap-remove-dead-code-from-md-bitmap.patch md-bitmap-tidy-up-i_writecount-handling-in-md-bitmap.patch md-bitmap-change-md-bitmap-file-handling-to-use-bmap-to-file-blocks.patch md-change-md-bitmap-file-handling-to-use-bmap-to-file-blocks-fix.patch md-calculate-correct-array-size-for-raid10-in-new-offset-mode.patch md-dm-reduce-stack-usage-with-stacked-block-devices.patch - To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html