target-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 01/18] Use block pr_ops in LIO
@ 2023-02-24 17:44 Mike Christie
  2023-02-24 17:44 ` [PATCH v4 01/18] block: Add PR callouts for read keys and reservation Mike Christie
                   ` (17 more replies)
  0 siblings, 18 replies; 49+ messages in thread
From: Mike Christie @ 2023-02-24 17:44 UTC (permalink / raw)
  To: bvanassche, hch, martin.petersen, linux-scsi, james.bottomley,
	linux-block, dm-devel, snitzer, axboe, linux-nvme, chaitanyak,
	kbusch, target-devel

The patches in this thread allow us to use the block pr_ops with LIO's
target_core_iblock module to support cluster applications in VMs. They
were built over Linus's tree. They also apply over linux-next and
Martin's tree. They could also apply over Jens's tree but it needs the
scsi_execute_cmd changes that just got merged into Linus's tree.

Currently, to use windows clustering or linux clustering (pacemaker +
cluster labs scsi fence agents) in VMs with LIO and vhost-scsi, you have
to use tcmu or pscsi or use a cluster aware FS/framework for the LIO pr
file. Setting up a cluster FS/framework is pain and waste when your real
backend device is already a distributed device, and pscsi and tcmu are
nice for specific use cases, but iblock gives you the best performance and
allows you to use stacked devices like dm-multipath. So these patches
allow iblock to work like pscsi/tcmu where they can pass a PR command to
the backend module. And then iblock will use the pr_ops to pass the PR
command to the real devices similar to what we do for unmap today.

The patches are separated in the following groups:
Patch 1 - 2:
- Add block layer callouts for reading reservations and rename reservation
  error code.
Patch 3 - 5:
- SCSI support for new callouts.
Patch 6:
- DM support for new callouts.
Patch 7 - 13:
- NVMe support for new callouts.
Patch 14 - 18:
- LIO support for new callouts.

This patchset has been tested with the libiscsi PGR ops and with window's
failover cluster verification test. Note that for scsi backend devices we
need this patchset:

https://lore.kernel.org/linux-scsi/20230123221046.125483-1-michael.christie@oracle.com/T/#m4834a643ffb5bac2529d65d40906d3cfbdd9b1b7

to handle UAs. To reduce the size of this patchset that's being done
separately to make reviewing easier. And to make merging easier this
patchset and the one above do not have any conflicts so can be merged
in different trees.

v4:
- Pass read_keys number of keys instead of array len
- Keep the switch use when converting between block and scsi/nvme PR
types. Drop default case so compiler spits out warning if in the future
a new value is added.
- Add helper for handling
nvme_send_ns_head_pr_command/nvme_send_ns_pr_command
- Use void * instead of u8* for passing data buffer.
- Rename status variable to rs.
- Have caller init buffer/structs instead of nvme/scsi callouts.
- Drop blk_status to err code.

v3:
- Fix patch subject formatting.
- Fix coding style.
- Rearrange patches so helpers are added with users to avoid compilation
errors.
- Move pr type conversion to array and add nvme_pr_type.
- Add Extended Data Structure control flag enum and use in code for checks.
- Move nvme pr code to new file.
- Add more info to patch subjects about why we need to add blk_status
to pr_ops.
- Use generic SCSI passthrough error handling interface.
- Fix checkpatch --strict errors. Note that I kept the existing coding
style that it complained about because it looked like it was the preferred
style for the code and I didn't want a mix and match.

v2:
- Drop BLK_STS_NEXUS rename changes. Will do separately.
- Add NVMe support.
- Fixed bug in target_core_iblock where a variable was not initialized
mentioned by Christoph.
- Fixed sd pr_ops UA handling issue found when running libiscsi PGR tests.
- Added patches to allow pr_ops to pass up a BLK_STS so we could return
a RESERVATION_CONFLICT status when a pr_ops callout fails.





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

end of thread, other threads:[~2023-03-20 17:14 UTC | newest]

Thread overview: 49+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-24 17:44 [PATCH v4 01/18] Use block pr_ops in LIO Mike Christie
2023-02-24 17:44 ` [PATCH v4 01/18] block: Add PR callouts for read keys and reservation Mike Christie
2023-03-06  5:03   ` Chaitanya Kulkarni
2023-03-14 17:10   ` Christoph Hellwig
2023-02-24 17:44 ` [PATCH v4 02/18] block: Rename BLK_STS_NEXUS to BLK_STS_RESV_CONFLICT Mike Christie
2023-03-14 17:11   ` Christoph Hellwig
2023-03-15 10:04     ` Stefan Haberland
2023-03-15 13:30       ` Christoph Hellwig
2023-03-16 10:17         ` Stefan Haberland
2023-03-16 16:36           ` Mike Christie
2023-03-20 13:06             ` Christoph Hellwig
2023-03-20 16:39               ` Mike Christie
2023-02-24 17:44 ` [PATCH v4 03/18] scsi: Rename sd_pr_command Mike Christie
2023-02-24 17:44 ` [PATCH v4 04/18] scsi: Move sd_pr_type to header to share Mike Christie
2023-03-06  5:06   ` Chaitanya Kulkarni
2023-02-24 17:44 ` [PATCH v4 05/18] scsi: Add support for block PR read keys/reservation Mike Christie
2023-03-06  5:08   ` Chaitanya Kulkarni
2023-03-14 17:11   ` Christoph Hellwig
2023-02-24 17:44 ` [PATCH v4 06/18] dm: " Mike Christie
2023-02-24 17:44 ` [PATCH v4 07/18] nvme: Fix reservation status related structs Mike Christie
2023-03-05 21:26   ` Chaitanya Kulkarni
2023-03-14 17:12   ` Christoph Hellwig
2023-03-14 17:15   ` Christoph Hellwig
2023-03-14 22:23     ` Mike Christie
2023-03-15  5:40       ` Christoph Hellwig
2023-03-20 17:08         ` Mike Christie
2023-02-24 17:44 ` [PATCH v4 08/18] nvme: Don't hardcode the data len for pr commands Mike Christie
2023-02-24 17:44 ` [PATCH v4 09/18] nvme: Move pr code to it's own file Mike Christie
2023-03-14 17:13   ` Christoph Hellwig
2023-03-14 17:30     ` Keith Busch
2023-02-24 17:44 ` [PATCH v4 10/18] nvme: Add helper to send pr command Mike Christie
2023-03-05 21:28   ` Chaitanya Kulkarni
2023-03-06 17:25     ` Mike Christie
2023-03-14 17:13   ` Christoph Hellwig
2023-02-24 17:44 ` [PATCH v4 11/18] nvme: Add pr_ops read_keys support Mike Christie
2023-03-14 17:16   ` Christoph Hellwig
2023-02-24 17:44 ` [PATCH v4 12/18] nvme: Add a nvme_pr_type enum Mike Christie
2023-03-05 21:30   ` Chaitanya Kulkarni
2023-03-14 17:17   ` Christoph Hellwig
2023-02-24 17:44 ` [PATCH v4 13/18] nvme: Add pr_ops read_reservation support Mike Christie
2023-02-24 21:04   ` kernel test robot
2023-03-06 17:25     ` Mike Christie
2023-03-05 21:32   ` Chaitanya Kulkarni
2023-03-14 17:21   ` Christoph Hellwig
2023-02-24 17:44 ` [PATCH v4 14/18] scsi: target: Rename sbc_ops to exec_cmd_ops Mike Christie
2023-02-24 17:44 ` [PATCH v4 15/18] scsi: target: Allow backends to hook into PR handling Mike Christie
2023-02-24 17:45 ` [PATCH v4 16/18] scsi: target: Pass struct target_opcode_descriptor to enabled Mike Christie
2023-02-24 17:45 ` [PATCH v4 17/18] scsi: target: Report and detect unsupported PR commands Mike Christie
2023-02-24 17:45 ` [PATCH v4 18/18] scsi: target: Add block PR support to iblock Mike Christie

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).