Re: [PATCH v2 6/6] generic: various atomic write tests with scsi_debug

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]



On Tue, May 20, 2025 at 07:30:52PM -0700, Darrick J. Wong wrote:
> On Tue, May 20, 2025 at 05:35:30PM +0530, Ritesh Harjani wrote:
> > Catherine Hoang <catherine.hoang@xxxxxxxxxx> writes:
> > 
> > > From: "Darrick J. Wong" <djwong@xxxxxxxxxx>

<snip> 
> > > +	cd /
> > > +	rm -r -f $tmp.*
> > > +}
> > > +
> > > +_require_scsi_debug
> > > +_require_scratch_nocheck
> > > +# Format something so that ./check doesn't freak out
> > > +_scratch_mkfs >> $seqres.full
> > > +
> > > +# 512b logical/physical sectors, 512M size, atomic writes enabled
> > > +dev=$(_get_scsi_debug_dev 512 512 0 512 "atomic_wr=1")
> > > +test -b "$dev" || _notrun "could not create atomic writes scsi_debug device"
> > > +
> > > +export SCRATCH_DEV=$dev
> > > +unset USE_EXTERNAL
> > > +
> > > +_require_scratch_write_atomic
> > > +_require_atomic_write_test_commands
> > 
> > Is it possible to allow pwrite -A to be tested on $SCRATCH_MNT rather
> > than on TEST_MNT? For e.g. 
> > 
> > What happens when TEST_DEV is not atomic write capable? Then this test
> > won't run even though we are passing scsi_debug which supports atomic writes.
> 
> Hrmmmm.  Maybe we need an open-coded version of the "make sure the
> xfs_io commands are present" checks without actually doing live testing
> of the $TEST_DIR since we're creating a scsi-debug with atomic write
> capability anyway.

I think it might be better to finally have a _require_scratch_xfs_io_command()
and hence a _require_scratch_atomic_write_commands. This can avoid the
open coding as well as future proof it for similar features.

> 
> > > +
> > > +echo "scsi_debug atomic write properties" >> $seqres.full
> > > +$XFS_IO_PROG -c "statx -r -m $STATX_WRITE_ATOMIC" $SCRATCH_DEV >> $seqres.full
> > > +
> > > +_scratch_mkfs >> $seqres.full
> > > +_scratch_mount
> > > +test "$FSTYP" = "xfs" && _xfs_force_bdev data $SCRATCH_MNT
> > > +
> > > +testfile=$SCRATCH_MNT/testfile
> > > +touch $testfile
> > > +
> > > +echo "filesystem atomic write properties" >> $seqres.full
> > > +$XFS_IO_PROG -c "statx -r -m $STATX_WRITE_ATOMIC" $testfile >> $seqres.full




[Index of Archives]     [Linux Filesystems Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux