From: John Garry <john.g.garry@oracle.com>
To: Ojaswin Mujoo <ojaswin@linux.ibm.com>
Cc: Zorro Lang <zlang@redhat.com>,
fstests@vger.kernel.org, Ritesh Harjani <ritesh.list@gmail.com>,
djwong@kernel.org, tytso@mit.edu, linux-xfs@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-ext4@vger.kernel.org
Subject: Re: [PATCH v6 09/12] generic: Add sudden shutdown tests for multi block atomic writes
Date: Thu, 18 Sep 2025 08:29:15 +0100 [thread overview]
Message-ID: <7d4d6e9a-2eff-4558-bfd0-4ef3b0f818f0@oracle.com> (raw)
In-Reply-To: <aMpsnQEYagLvPOw2@li-dc0c254c-257c-11b2-a85c-98b6c1322444.ibm.com>
On 17/09/2025 09:09, Ojaswin Mujoo wrote:
>> nit: I think that I mentioned this the last time - I would not use the word
>> "expected". We have old data, new data, and actual data. The only thing
>> which we expect is that actual data will be either all old or all new.
>
> Hey John so I mentioned here [1] that the wording "expected new",
> "expected old", "actual" looked more clear to me than "new", "old" and
> "actual" and you replied with sure so I though we were good there 🙂
>
> But no worries I can make this change. I'll keep the wording as
> new, old and actual.
great, thanks
>
>>> + echo "$expected_data_old"
>>> + echo
>>> + echo "Expected new: "
>>> + echo "$expected_data_new"
>>> + echo
>>> + echo "Actual contents: "
>>> + echo "$actual_data"
>>> +
>>> + _fail
>>> + fi
>>> + echo -n "Check at offset $off succeeded! " >> $seqres.full
>>> + if [[ "$actual_data" == "$expected_data_new" ]]
>>> + then
>>> + echo "matched new" >> $seqres.full
>>> + elif [[ "$actual_data" == "$expected_data_old" ]]
>>> + then
>>> + echo "matched old" >> $seqres.full
>>> + fi
>>> + off=$(( off + awu_max ))
>>> + done
>>> +}
>>> +
>>> +# test data integrity for file by shutting down in between atomic writes
>>> +test_data_integrity() {
>>> + echo >> $seqres.full
>>> + echo "# Writing atomically to file in background" >> $seqres.full
>>> +
>>> + start_atomic_write_and_shutdown
>>> +
>>> + last_offset=$(tail -n 1 $tmp.aw | cut -d" " -f4)
>>> + if [[ -z $last_offset ]]
>>> + then
>>> + last_offset=0
>>> + fi
>>> +
>>> + echo >> $seqres.full
>>> + echo "# Last offset of atomic write: $last_offset" >> $seqres.full
>>> +
>>> + rm $tmp.aw
>>> + sleep 0.5
>>> +
>>> + _scratch_cycle_mount
>>> +
>>> + # we want to verify all blocks around which the shutdown happened
>>> + verify_start=$(( last_offset - (awu_max * 5)))
>>> + if [[ $verify_start < 0 ]]
>>> + then
>>> + verify_start=0
>>> + fi
>>> +
>>> + verify_end=$(( last_offset + (awu_max * 5)))
>>> + if [[ "$verify_end" -gt "$filesize" ]]
>>> + then
>>> + verify_end=$filesize
>>> + fi
>>> +}
>>> +
>>> +# test data integrity for file with written and unwritten mappings
>>> +test_data_integrity_mixed() {
>>> + $XFS_IO_PROG -fc "truncate 0" $testfile >> $seqres.full
>>> +
>>> + echo >> $seqres.full
>>> + echo "# Creating testfile with mixed mappings" >> $seqres.full
>>> + create_mixed_mappings $testfile $filesize
>>> +
>>> + test_data_integrity
>>> +
>>> + verify_data_blocks $verify_start $verify_end "$expected_data_old_mixed" "$expected_data_new"
>>> +}
>>> +
>>> +# test data integrity for file with completely written mappings
>>> +test_data_integrity_written() {
>> nit: again, I am not so keen on using the word "integrity" at all.
>> "integrity" in storage world relates to T10 PI support in Linux. I know that
>> last time I mentioned it's ok to use "integrity" when close to words "atomic
>> write", but I still fear some doubt on whether we are talking about T10 PI
>> when we mention integrity.
> Okay got it, fine then how about using phrases like "test for torn
> data for file with completely written mapping" and such?
sure, it's ok
Thanks very much
next prev parent reply other threads:[~2025-09-18 7:29 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-11 17:13 [PATCH v6 00/11] Add more tests for multi fs block atomic writes Ojaswin Mujoo
2025-09-11 17:13 ` [PATCH v6 01/12] common/rc: Add _min() and _max() helpers Ojaswin Mujoo
2025-09-12 16:53 ` John Garry
2025-09-15 11:19 ` Ojaswin Mujoo
2025-09-11 17:13 ` [PATCH v6 02/12] common/rc: Add fio atomic write helpers Ojaswin Mujoo
2025-09-15 13:11 ` John Garry
2025-09-11 17:13 ` [PATCH v6 03/12] common/rc: Add a helper to run fsx on a given file Ojaswin Mujoo
2025-09-15 13:12 ` John Garry
2025-09-11 17:13 ` [PATCH v6 04/12] ltp/fsx.c: Add atomic writes support to fsx Ojaswin Mujoo
2025-09-11 17:13 ` [PATCH v6 05/12] generic: Add atomic write test using fio crc check verifier Ojaswin Mujoo
2025-09-11 17:13 ` [PATCH v6 06/12] generic: Add atomic write test using fio verify on file mixed mappings Ojaswin Mujoo
2025-09-11 17:13 ` [PATCH v6 07/12] generic: Add atomic write multi-fsblock O_[D]SYNC tests Ojaswin Mujoo
2025-09-11 17:13 ` [PATCH v6 08/12] generic: Stress fsx with atomic writes enabled Ojaswin Mujoo
2025-09-11 17:13 ` [PATCH v6 09/12] generic: Add sudden shutdown tests for multi block atomic writes Ojaswin Mujoo
2025-09-15 13:26 ` John Garry
2025-09-17 8:09 ` Ojaswin Mujoo
2025-09-18 7:29 ` John Garry [this message]
2025-09-11 17:13 ` [PATCH v6 10/12] ext4: Test atomic write and ioend codepaths with bigalloc Ojaswin Mujoo
2025-09-11 17:13 ` [PATCH v6 11/12] ext4: Test atomic writes allocation and write " Ojaswin Mujoo
2025-09-11 17:13 ` [PATCH v6 12/12] ext4: Atomic write test for extent split across leaf nodes Ojaswin Mujoo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7d4d6e9a-2eff-4558-bfd0-4ef3b0f818f0@oracle.com \
--to=john.g.garry@oracle.com \
--cc=djwong@kernel.org \
--cc=fstests@vger.kernel.org \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-xfs@vger.kernel.org \
--cc=ojaswin@linux.ibm.com \
--cc=ritesh.list@gmail.com \
--cc=tytso@mit.edu \
--cc=zlang@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox