On Mon, May 19, 2025 at 06:33:57PM -0700, Catherine Hoang wrote: > From: "Darrick J. Wong" <djwong@xxxxxxxxxx> > > Move the common atomic writes code to common/atomic so we can share s/atomic/atomicwrites/ > them. > > Signed-off-by: "Darrick J. Wong" <djwong@xxxxxxxxxx> > Signed-off-by: Catherine Hoang <catherine.hoang@xxxxxxxxxx> > Reviewed-by: John Garry <john.g.garry@xxxxxxxxxx> > Reviewed-by: Ritesh Harjani (IBM) <ritesh.list@xxxxxxxxx> Looks good: Reviewed-by: Ojaswin Mujoo <ojaswin@xxxxxxxxxxxxx> just a minor comment below: <snip> > --- > common/atomicwrites | 111 ++++++++++++++++++++++++++++++++++++++++++++ > common/rc | 47 ------------------- > tests/generic/765 | 53 ++------------------- > 3 files changed, 114 insertions(+), 97 deletions(-) > create mode 100644 common/atomicwrites > > + > +_test_atomic_file_writes() Since we use this for mostly bound checks and single mapping checks, maybe we can name this as _test_atomic_file_writes_sanity() or something along those lines? Im okay either ways, just thought its a bit confusing to call _test_atomic_file_writes() and then doing more tests after that. Regards, ojaswin > +{ > + local bsize="$1" > + local testfile="$2" > + local bytes_written > + local testfile_cp="$testfile.copy" > + > + # Check that we can perform an atomic write of len = FS block size > + bytes_written=$($XFS_IO_PROG -dc "pwrite -A -D -V1 -b $bsize 0 $bsize" $testfile | \ > + grep wrote | awk -F'[/ ]' '{print $2}') > + test $bytes_written -eq $bsize || echo "atomic write len=$bsize failed"