Message ID | CAOi1vP-amFyFHbPV3FhG3F1Tp+df6V7a4mcP8LLWY0GZx+JsFw@mail.gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
>>>>> "Ilya" == Ilya Dryomov <idryomov@gmail.com> writes:
Ilya,
Ilya> Well, blk_integrity_revalidate() doesn't clear the profile, it
Ilya> just clears the stable pages flag. Whoever calls
Ilya> blk_integrity_unregister() to clear the profile can also clear the
Ilya> stable pages flag -- why not let blk_integrity_unregister() clear
Ilya> the flag like I suggested?
That's what it used to do.
blk_integrity_revalidate() was obviously introduced to overcome some
problem. Unfortunately, I can't recall what that was and Google isn't
being particularly helpful. I suspect it was either in the NVDIMM or
NVMe camps since that's where the churn was.
I don't have a problem with your patch as long as we're sure there are
no regressions. I would carry the gendisk check over, though.
On Fri, Feb 24, 2017 at 12:49 AM, Martin K. Petersen <martin.petersen@oracle.com> wrote: >>>>>> "Ilya" == Ilya Dryomov <idryomov@gmail.com> writes: > > Ilya, > > Ilya> Well, blk_integrity_revalidate() doesn't clear the profile, it > Ilya> just clears the stable pages flag. Whoever calls > Ilya> blk_integrity_unregister() to clear the profile can also clear the > Ilya> stable pages flag -- why not let blk_integrity_unregister() clear > Ilya> the flag like I suggested? > > That's what it used to do. > > blk_integrity_revalidate() was obviously introduced to overcome some > problem. Unfortunately, I can't recall what that was and Google isn't > being particularly helpful. I suspect it was either in the NVDIMM or > NVMe camps since that's where the churn was. Adding more people from 25520d55cdb6 -- does anyone remember the story behind blk_integrity_revalidate()? > > I don't have a problem with your patch as long as we're sure there are > no regressions. I would carry the gendisk check over, though. I spent quite some time trying to do basic tests on nvme, since it uses both nop_profile and real integrity profiles. Unfortunately I don't have access to an nvme card with separate-metadata capability and upstream qemu driver doesn't support any metadata capabilities at all, so I turned to https://github.com/OpenChannelSSD/qemu-nvme. It lets you configure mc and multiple lbafs, but commit ff646a5841f743fdd9cfef138ac6be1f0ba4fbfb Author: Keith Busch <keith.busch@intel.com> Thu Oct 23 20:02:44 2014 As part of this, I am removing all meta-data support. It's not well supported in any immediatly available operating system, so the code is not well tested. In the end I got it into a semi-working state by checking out an old version and dropping some sanity checks. I formatted the namespace in a number of ways -- bdi/stable_pages_required and integrity/format behaved as expected ("none", "nop", "T10-DIF-TYPE1-CRC"). Given the above, I'm not sure what the baseline is -- blk_integrity code isn't invoked for data-only lbafs. Could nvme folks please look at this? rbd regression caused by integrity revalidate change goes back to 4.4 and I'd really like to get it fixed. The proposed patch is attached to my earlier reply on linux-block. Thanks, Ilya -- To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
>>>>> "Ilya" == Ilya Dryomov <idryomov@gmail.com> writes:
Ilya,
Ilya> Given the above, I'm not sure what the baseline is --
Ilya> blk_integrity code isn't invoked for data-only lbafs. Could nvme
Ilya> folks please look at this? rbd regression caused by integrity
Ilya> revalidate change goes back to 4.4 and I'd really like to get it
Ilya> fixed. The proposed patch is attached to my earlier reply on
Ilya> linux-block.
I've had a couple of fires to attend to this week. I'll try and give
your patch a spin on my FC setup tomorrow or Friday.
On Thu, Mar 2, 2017 at 4:24 AM, Martin K. Petersen <martin.petersen@oracle.com> wrote: >>>>>> "Ilya" == Ilya Dryomov <idryomov@gmail.com> writes: > > Ilya, > > Ilya> Given the above, I'm not sure what the baseline is -- > Ilya> blk_integrity code isn't invoked for data-only lbafs. Could nvme > Ilya> folks please look at this? rbd regression caused by integrity > Ilya> revalidate change goes back to 4.4 and I'd really like to get it > Ilya> fixed. The proposed patch is attached to my earlier reply on > Ilya> linux-block. > > I've had a couple of fires to attend to this week. I'll try and give > your patch a spin on my FC setup tomorrow or Friday. Hi Martin, Ping... Did you get a chance to try it? Thanks, Ilya -- To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
From 24a0cf8bc437a65b3986e9ab25cf2f05e6bbd5d0 Mon Sep 17 00:00:00 2001 From: Ilya Dryomov <idryomov@gmail.com> Date: Mon, 20 Feb 2017 18:50:50 +0100 Subject: [PATCH] block: get rid of blk_integrity_revalidate() Commit 25520d55cdb6 ("block: Inline blk_integrity in struct gendisk") introduced blk_integrity_revalidate(), which clears the stable pages bit if no blk_integrity profile is registered. It's called from revalidate_disk() and rescan_partitions(), making it impossible to set BDI_CAP_STABLE_WRITES for drivers that support partitions and don't use blk_integrity. One such driver is rbd, where the ceph messenger is responsible for generating/verifying CRCs. Since blk_integrity_{un,}register() "must" be used for (un)registering the integrity profile with the block layer, move BDI_CAP_STABLE_WRITES setting there. This way drivers that call blk_integrity_register() and use integrity infrastructure won't interfere with drivers that don't but still want stable pages. Fixes: 25520d55cdb6 ("block: Inline blk_integrity in struct gendisk") Signed-off-by: Ilya Dryomov <idryomov@gmail.com> --- block/blk-integrity.c | 19 ++----------------- block/partition-generic.c | 1 - fs/block_dev.c | 1 - include/linux/genhd.h | 2 -- 4 files changed, 2 insertions(+), 21 deletions(-) diff --git a/block/blk-integrity.c b/block/blk-integrity.c index d69c5c79f98e..319f2e4f4a8b 100644 --- a/block/blk-integrity.c +++ b/block/blk-integrity.c @@ -417,7 +417,7 @@ void blk_integrity_register(struct gendisk *disk, struct blk_integrity *template bi->tuple_size = template->tuple_size; bi->tag_size = template->tag_size; - blk_integrity_revalidate(disk); + disk->queue->backing_dev_info.capabilities |= BDI_CAP_STABLE_WRITES; } EXPORT_SYMBOL(blk_integrity_register); @@ -430,26 +430,11 @@ EXPORT_SYMBOL(blk_integrity_register); */ void blk_integrity_unregister(struct gendisk *disk) { - blk_integrity_revalidate(disk); + disk->queue->backing_dev_info.capabilities &= ~BDI_CAP_STABLE_WRITES; memset(&disk->queue->integrity, 0, sizeof(struct blk_integrity)); } EXPORT_SYMBOL(blk_integrity_unregister); -void blk_integrity_revalidate(struct gendisk *disk) -{ - struct blk_integrity *bi = &disk->queue->integrity; - - if (!(disk->flags & GENHD_FL_UP)) - return; - - if (bi->profile) - disk->queue->backing_dev_info.capabilities |= - BDI_CAP_STABLE_WRITES; - else - disk->queue->backing_dev_info.capabilities &= - ~BDI_CAP_STABLE_WRITES; -} - void blk_integrity_add(struct gendisk *disk) { if (kobject_init_and_add(&disk->integrity_kobj, &integrity_ktype, diff --git a/block/partition-generic.c b/block/partition-generic.c index 7afb9907821f..0171a2faad68 100644 --- a/block/partition-generic.c +++ b/block/partition-generic.c @@ -497,7 +497,6 @@ int rescan_partitions(struct gendisk *disk, struct block_device *bdev) if (disk->fops->revalidate_disk) disk->fops->revalidate_disk(disk); - blk_integrity_revalidate(disk); check_disk_size_change(disk, bdev); bdev->bd_invalidated = 0; if (!get_capacity(disk) || !(state = check_partition(disk, bdev))) diff --git a/fs/block_dev.c b/fs/block_dev.c index 3c47614a4b32..b94e2a4974a1 100644 --- a/fs/block_dev.c +++ b/fs/block_dev.c @@ -1422,7 +1422,6 @@ int revalidate_disk(struct gendisk *disk) if (disk->fops->revalidate_disk) ret = disk->fops->revalidate_disk(disk); - blk_integrity_revalidate(disk); bdev = bdget_disk(disk, 0); if (!bdev) return ret; diff --git a/include/linux/genhd.h b/include/linux/genhd.h index 76f39754e7b0..76d6a1cd4153 100644 --- a/include/linux/genhd.h +++ b/include/linux/genhd.h @@ -722,11 +722,9 @@ static inline void part_nr_sects_write(struct hd_struct *part, sector_t size) #if defined(CONFIG_BLK_DEV_INTEGRITY) extern void blk_integrity_add(struct gendisk *); extern void blk_integrity_del(struct gendisk *); -extern void blk_integrity_revalidate(struct gendisk *); #else /* CONFIG_BLK_DEV_INTEGRITY */ static inline void blk_integrity_add(struct gendisk *disk) { } static inline void blk_integrity_del(struct gendisk *disk) { } -static inline void blk_integrity_revalidate(struct gendisk *disk) { } #endif /* CONFIG_BLK_DEV_INTEGRITY */ #else /* CONFIG_BLOCK */ -- 2.4.3