From: Disha Goel <disgoel@linux.ibm.com>
To: Anand Jain <anajain.sg@gmail.com>, fstests@vger.kernel.org
Cc: linux-btrfs@vger.kernel.org, ritesh.list@gmail.com,
ojaswin@linux.ibm.com, djwong@kernel.org, fdmanana@kernel.org,
quwenruo.btrfs@gmx.com, zlang@kernel.org
Subject: Re: [PATCH 1/2] common/dmlogwrites: add _require_logwrites_size helper
Date: Mon, 27 Apr 2026 18:03:56 +0530 [thread overview]
Message-ID: <14822154-4cd4-4ca0-b3f2-ce91902d1391@linux.ibm.com> (raw)
In-Reply-To: <c27c678b-89b2-40e0-9b12-23b0807f74ed@gmail.com>
On 22/04/26 5:21 pm, Anand Jain wrote:
> On 14/4/26 18:20, Disha Goel wrote:
>> Add a new helper function _require_logwrites_size() to check if the
>> LOGWRITES_DEV meets a minimum size requirement.
>>
>> This is useful for tests that use dm-log-writes with additional space
>> requirements, such as creating LVM snapshots during log replay or tests
>> that generate large amounts of logged I/O operations.
>>
>> The function takes a size parameter in KB and skips the test if
>> LOGWRITES_DEV is smaller than the required size.
>>
>> Signed-off-by: Disha Goel <disgoel@linux.ibm.com>
>> ---
>> common/dmlogwrites | 9 +++++++++
>> 1 file changed, 9 insertions(+)
>>
>> diff --git a/common/dmlogwrites b/common/dmlogwrites
>> index a27e1966..1ce2b2fb 100644
>> --- a/common/dmlogwrites
>> +++ b/common/dmlogwrites
>> @@ -14,6 +14,15 @@ _require_log_writes()
>> _require_test_program "log-writes/replay-log"
>> }
>>
>> +_require_logwrites_size()
>> +{
>> + [ $# -eq 1 ] || _fail "_require_logwrites_size: expected size param"
>> +
>> + local devsize=$(_get_device_size $LOGWRITES_DEV)
>> + [ $devsize -lt $1 ] && \
>> + _notrun "LOGWRITES_DEV too small, ${devsize}KB < $1KB"
>> +}
>> +
>> # Starting from v4.15-rc1, DAX support was added to dm-log-writes, but note
>> # that it doesn't track the data that we write via the mmap(), so we can't do
>> # any data integrity checking. We can only verify that the metadata writes for
>
>
> _require_logwrites_size() should be designed something like this
>
> _require_log_writes_sized()
> {
> local size=$1
>
> _require_log_writes
> check $size || _notrun
> }
>
> So, patch 2/2 can simply call `_require_log_writes_sized <>`
>
> Thanks.
Thanks for the suggestion. I've implemented this in v2.
v2 has been sent:
https://lore.kernel.org/fstests/20260427122551.71696-1-disgoel@linux.ibm.com/T/#t
--
Regards,
Disha
prev parent reply other threads:[~2026-04-27 12:34 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-14 10:20 [PATCH 1/2] common/dmlogwrites: add _require_logwrites_size helper Disha Goel
2026-04-14 10:20 ` [PATCH 2/2] btrfs/291: fix state transition logic and add size requirement Disha Goel
2026-04-22 5:38 ` [PATCH 1/2] common/dmlogwrites: add _require_logwrites_size helper Disha Goel
2026-04-22 15:55 ` Darrick J. Wong
2026-04-27 12:31 ` Disha Goel
2026-04-22 11:51 ` Anand Jain
2026-04-27 12:33 ` Disha Goel [this message]
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=14822154-4cd4-4ca0-b3f2-ce91902d1391@linux.ibm.com \
--to=disgoel@linux.ibm.com \
--cc=anajain.sg@gmail.com \
--cc=djwong@kernel.org \
--cc=fdmanana@kernel.org \
--cc=fstests@vger.kernel.org \
--cc=linux-btrfs@vger.kernel.org \
--cc=ojaswin@linux.ibm.com \
--cc=quwenruo.btrfs@gmx.com \
--cc=ritesh.list@gmail.com \
--cc=zlang@kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.