Re: [Patch v9 09/10] scsi: scsi_debug: Atomic write support
Hannes Reinecke <[email protected]>
| Newsgroups | gmane.linux.kernel.aio.general,gmane.linux.block,gmane.linux.kernel,gmane.linux.file-systems,gmane.linux.scsi,gmane.comp.file-systems.btrfs,gmane.linux.kernel.io-uring |
|---|---|
| Message-ID | <[email protected]> |
On 6/20/24 14:53, John Garry wrote: > Add initial support for atomic writes. > > As is standard method, feed device properties via modules param, those > being: > - atomic_max_size_blks > - atomic_alignment_blks > - atomic_granularity_blks > - atomic_max_size_with_boundary_blks > - atomic_max_boundary_blks > > These just match sbc4r22 section 6.6.4 - Block limits VPD page. > > We just support ATOMIC WRITE (16). > > The major change in the driver is how we lock the device for RW accesses. > > Currently the driver uses a per-device lock for accessing device metadata > and "media" data (calls to do_device_access()) atomically for the duration > of the whole read/write command. > > This should not suit verifying atomic writes. Reason being that currently > all reads/writes are atomic, so using atomic writes does not prove > anything. > > Change device access model to basis that regular writes only atomic on a > per-sector basis, while reads and atomic writes are fully atomic. > > As mentioned, since accessing metadata and device media is atomic, > continue to have regular writes involving metadata - like discard or PI - > as atomic. We can improve this later. > > Currently we only support model where overlapping going reads or writes > wait for current access to complete before commencing an atomic write. > This is described in 4.29.3.2 section of the SBC. However, we simplify, > things and wait for all accesses to complete (when issuing an atomic > write). > > Reviewed-by: Martin K. Petersen <[email protected]> > Signed-off-by: John Garry <[email protected]> > --- > drivers/scsi/scsi_debug.c | 588 +++++++++++++++++++++++++++++--------- > 1 file changed, 454 insertions(+), 134 deletions(-) > Reviewed-by: Hannes Reinecke <[email protected]> Cheers, Hannes -- Dr. Hannes Reinecke Kernel Storage Architect [email protected] +49 911 74053 688 SUSE Software Solutions GmbH, Frankenstr. 146, 90461 Nürnberg HRB 36809 (AG Nürnberg), GF: I. Totev, A. McDonald, W. Knoblich -- To unsubscribe, send a message with 'unsubscribe linux-aio' in the body to [email protected]. For more info on Linux AIO, see: http://www.kvack.org/aio/ Don't email: <a href=mailto:"[email protected]">[email protected]</a>