linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 00/12] blk-integrity lifetime fixes
@ 2015-10-15 19:59 Dan Williams
  2015-10-15 19:59 ` [PATCH v2 01/12] block: Move integrity kobject to struct gendisk Dan Williams
                   ` (12 more replies)
  0 siblings, 13 replies; 33+ messages in thread
From: Dan Williams @ 2015-10-15 19:59 UTC (permalink / raw)


Changes since v1 [1]:
1/ Added a unification of nop profile definitions (Christoph)

2/ Fixed the CONFIG_BLK_DEV_INTEGRITY=n case (Martin)

3/ Folded a fix into "block: Consolidate static integrity profile
   properties", and squahsed the blk_integrity_unregister() removal patches
   into one. (Christoph, Martin)

4/ Collected Acked and Tested -by's from Keith, Neil, Vishal, and Ross

5/ Fixed up Documentation/ABI/testing/sysfs-block to reflect moving
   "integrity" sysfs attributes from "disk" to "disk/queue".

[1]: https://lists.01.org/pipermail/linux-nvdimm/2015-October/002430.html

---

The recent "Block integrity registration update" caused a failing
signature that had been triggering intermittently in the libnvdimm unit
tests to start failing reliably every run.  These tests run through
several blk_integrity configurations and as result exercise the
block-device setup/teardown path.  This is a re-flow of "Block integrity
registration update" with incremental fixes.

Patches apply on Jens' block.git for-4.4/drivers, also available here:

   git://git.kernel.org/pub/scm/linux/kernel/git/djbw/nvdimm for-4.4/blk-integrity

---

Dan Williams (7):
      md, dm, scsi, nvme, libnvdimm: drop blk_integrity_unregister() at shutdown
      md: suspend i/o during runtime blk_integrity_unregister
      nvme: suspend i/o during runtime blk_integrity_unregister
      block: generic request_queue reference counting
      block: move blk_integrity to request_queue
      block: blk_flush_integrity() for bio-based drivers
      block, libnvdimm, nvme: provide a built-in blk_integrity nop profile

Martin K. Petersen (5):
      block: Move integrity kobject to struct gendisk
      block: Consolidate static integrity profile properties
      block: Reduce the size of struct blk_integrity
      block: Export integrity data interval size in sysfs
      block: Inline blk_integrity in struct gendisk


 Documentation/ABI/testing/sysfs-block |   17 ++-
 block/bio-integrity.c                 |   17 ++-
 block/blk-core.c                      |   74 +++++++++++-
 block/blk-integrity.c                 |  199 +++++++++++++++------------------
 block/blk-mq-sysfs.c                  |    6 -
 block/blk-mq.c                        |   80 ++++---------
 block/blk-sysfs.c                     |    7 +
 block/blk.h                           |   22 ++++
 block/partition-generic.c             |    1 
 block/t10-pi.c                        |   16 +--
 drivers/md/dm-table.c                 |   88 ++++++++-------
 drivers/md/dm.c                       |    2 
 drivers/md/md.c                       |   13 +-
 drivers/md/multipath.c                |    2 
 drivers/md/raid1.c                    |    2 
 drivers/md/raid10.c                   |    2 
 drivers/nvdimm/btt.c                  |    1 
 drivers/nvdimm/core.c                 |   21 +--
 drivers/nvme/host/pci.c               |   40 ++-----
 drivers/scsi/sd.c                     |    1 
 drivers/scsi/sd_dif.c                 |   29 +++--
 drivers/target/target_core_iblock.c   |   10 +-
 fs/block_dev.c                        |    2 
 include/linux/blk-mq.h                |    1 
 include/linux/blkdev.h                |   54 ++++-----
 include/linux/genhd.h                 |   25 ++++
 include/linux/t10-pi.h                |    8 +
 27 files changed, 383 insertions(+), 357 deletions(-)

^ permalink raw reply	[flat|nested] 33+ messages in thread
* [PATCH 5/5] block: Inline blk_integrity in struct gendisk
@ 2015-08-21 23:47 Busch, Keith
  2015-10-12 21:05 ` Block integrity registration update Martin K. Petersen
  0 siblings, 1 reply; 33+ messages in thread
From: Busch, Keith @ 2015-08-21 23:47 UTC (permalink / raw)


On Thu, Aug 20 2015, Martin K. Petersen wrote:
> -static struct gendisk * dm_table_get_integrity_disk(struct dm_table *t,
> -						    bool match_all)
> +static struct gendisk * dm_table_get_integrity_disk(struct dm_table *t)
>  {
>  	struct list_head *devices = dm_table_get_devices(t);
>  	struct dm_dev_internal *dd = NULL;
> @@ -1030,11 +1026,7 @@ static struct gendisk * dm_table_get_integrity_disk(struct dm_table *t,
> 
>  	list_for_each_entry(dd, devices, list) {
>  		template_disk = dd->dm_dev->bdev->bd_disk;
> -		if (!blk_get_integrity(template_disk))
> -			goto no_integrity;


The blk_get_integrity check is necessary to prevent a kernel crash. Without it,
this function will return a template disk without integrity and later attempt to
register a NULL disk->integrity.

Otherwise, looks good! I will post the nvme driver patch removing the two pass
disk revalidation since that's no longer necessary with this good stuff.


> -		if (!match_all && !blk_integrity_is_initialized(template_disk))
> -			continue; /* skip uninitialized profiles */
> -		else if (prev_disk &&
> +		if (prev_disk &&
>  			 blk_integrity_compare(prev_disk, template_disk) < 0)
>  			goto no_integrity;
>  		prev_disk = template_disk;

^ permalink raw reply	[flat|nested] 33+ messages in thread
* [PATCH 5/5] block: Inline blk_integrity in struct gendisk
@ 2015-07-21 12:01 Christoph Hellwig
  2015-08-20 20:41 ` Simplify block integrity registration Martin K. Petersen
  0 siblings, 1 reply; 33+ messages in thread
From: Christoph Hellwig @ 2015-07-21 12:01 UTC (permalink / raw)


On Tue, Jul 21, 2015@02:02:59AM -0400, Martin K. Petersen wrote:
>  - Moving the blk_integrity definitions to genhd.h.

You only need to move struct blk_integrity.  as that one only has a
pointer to struct blk_integrity_profile there is no need to move he
rest.

Otherwise this looks good, although eplace calls to
blk_integrity_register with a NULL integrity profile with direct calls
to blk_integrity_unregister.

^ permalink raw reply	[flat|nested] 33+ messages in thread
* [PATCH] NVMe: Reread partitions on metadata formats
@ 2015-07-16  9:19 Christoph Hellwig
  2015-07-21  6:02 ` Data integrity tweaks Martin K. Petersen
  0 siblings, 1 reply; 33+ messages in thread
From: Christoph Hellwig @ 2015-07-16  9:19 UTC (permalink / raw)


On Wed, Jul 15, 2015@10:28:32PM +0000, Keith Busch wrote:
> Should we make it so a driver can register with blk-integrity prior to
> calling add_disk()? The other thread on this issue sounded like that'd
> be better and removes the extra driver complexity to call blk_reread_part
> or revalidate after add_disk.
> 
> Here's a patch for that and the resulting nvme driver. It works the same
> as today if registered after add_disk(), but safe to call prior. If
> called prior, add_disk() handles the queue and backing info settings
> for integrity, and adds the kobj.

This looks sensible to me as a quick fix for the issue.

In the lng run I'd prefer to just pass the integrity template
to add_disk (or rather an add_disk_integrity helper, for which
add_disk becomes a wrapper).

Also the way struct blk_integrity is used is a bit of a mess,
instead of passing it and then copying into a newly allocated
copy of it I'd rather move the kobj to struct gendisk and then
just have a pointer to the original template in struct gendisk.

^ permalink raw reply	[flat|nested] 33+ messages in thread

end of thread, other threads:[~2015-10-23 20:21 UTC | newest]

Thread overview: 33+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-15 19:59 [PATCH v2 00/12] blk-integrity lifetime fixes Dan Williams
2015-10-15 19:59 ` [PATCH v2 01/12] block: Move integrity kobject to struct gendisk Dan Williams
2015-10-23 20:21   ` Jeff Moyer
2015-10-15 19:59 ` [PATCH v2 02/12] block: Consolidate static integrity profile properties Dan Williams
2015-10-15 19:59 ` [PATCH v2 03/12] block: Reduce the size of struct blk_integrity Dan Williams
2015-10-15 20:00 ` [PATCH v2 04/12] block: Export integrity data interval size in sysfs Dan Williams
2015-10-15 20:00 ` [PATCH v2 05/12] block: Inline blk_integrity in struct gendisk Dan Williams
2015-10-15 20:00 ` [PATCH v2 06/12] md, dm, scsi, nvme, libnvdimm: drop blk_integrity_unregister() at shutdown Dan Williams
2015-10-15 20:00 ` [PATCH v2 07/12] md: suspend i/o during runtime blk_integrity_unregister Dan Williams
2015-10-15 20:00 ` [PATCH v2 08/12] nvme: " Dan Williams
2015-10-15 20:00 ` [PATCH v2 09/12] block: generic request_queue reference counting Dan Williams
2015-10-15 20:00 ` [PATCH v2 10/12] block: move blk_integrity to request_queue Dan Williams
2015-10-16  0:42   ` Williams, Dan J
2015-10-20  2:24     ` Martin K. Petersen
2015-10-20  2:45       ` Simplify block integrity registration v2 Martin K. Petersen
2015-10-20  2:45         ` [PATCH 1/5] block: Move integrity kobject to struct gendisk Martin K. Petersen
2015-10-20  2:45         ` [PATCH 2/5] block: Consolidate static integrity profile properties Martin K. Petersen
2015-10-20 18:20           ` Dan Williams
2015-10-20  2:45         ` [PATCH 3/5] block: Reduce the size of struct blk_integrity Martin K. Petersen
2015-10-20  2:45         ` [PATCH 4/5] block: Export integrity data interval size in sysfs Martin K. Petersen
2015-10-20  2:45         ` [PATCH 5/5] block: Inline blk_integrity in struct gendisk Martin K. Petersen
2015-10-21  7:22         ` Simplify block integrity registration v2 Christoph Hellwig
2015-10-21 15:45           ` Dan Williams
2015-10-21 16:35             ` Martin K. Petersen
2015-10-15 20:00 ` [PATCH v2 11/12] block: blk_flush_integrity() for bio-based drivers Dan Williams
2015-10-15 20:00 ` [PATCH v2 12/12] block, libnvdimm, nvme: provide a built-in blk_integrity nop profile Dan Williams
2015-10-15 23:53 ` [PATCH v2 00/12] blk-integrity lifetime fixes Martin K. Petersen
2015-10-16  0:06   ` Dan Williams
  -- strict thread matches above, loose matches on Subject: below --
2015-08-21 23:47 [PATCH 5/5] block: Inline blk_integrity in struct gendisk Busch, Keith
2015-10-12 21:05 ` Block integrity registration update Martin K. Petersen
2015-10-12 21:05   ` [PATCH 1/5] block: Move integrity kobject to struct gendisk Martin K. Petersen
2015-07-21 12:01 [PATCH 5/5] block: Inline blk_integrity in " Christoph Hellwig
2015-08-20 20:41 ` Simplify block integrity registration Martin K. Petersen
2015-08-20 20:41   ` [PATCH 1/5] block: Move integrity kobject to struct gendisk Martin K. Petersen
2015-09-16 17:26     ` Mike Snitzer
2015-07-16  9:19 [PATCH] NVMe: Reread partitions on metadata formats Christoph Hellwig
2015-07-21  6:02 ` Data integrity tweaks Martin K. Petersen
2015-07-21  6:02   ` [PATCH 1/5] block: Move integrity kobject to struct gendisk Martin K. Petersen
2015-07-22 11:32     ` Sagi Grimberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).