Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: Zorro Lang <zlang@kernel.org>
To: Disha Goel <disgoel@linux.ibm.com>
Cc: fstests@vger.kernel.org, linux-btrfs@vger.kernel.org,
	 ritesh.list@gmail.com, ojaswin@linux.ibm.com, djwong@kernel.org,
	fdmanana@kernel.org,  quwenruo.btrfs@gmx.com,
	anajain.sg@gmail.com
Subject: Re: [PATCH v3 1/2] common/dmlogwrites: add _require_log_writes_sized helper
Date: Mon, 11 May 2026 22:31:56 +0800	[thread overview]
Message-ID: <agHm1zCSzmZ1DL4a@zlang-mailbox> (raw)
In-Reply-To: <20260508144701.68561-1-disgoel@linux.ibm.com>

On Fri, May 08, 2026 at 08:17:00PM +0530, Disha Goel wrote:
> Add a new helper function _require_log_writes_sized() 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, calls _require_log_writes()
> internally, and skips the test if LOGWRITES_DEV is smaller than the
> required size.
> 
> Suggested-by: Darrick J. Wong <djwong@kernel.org>
> Suggested-by: Anand Jain <anajain.sg@gmail.com>
> Signed-off-by: Disha Goel <disgoel@linux.ibm.com>
> ---
> v2 -> v3:
> - Fixed variable declaration order - declare all local variables at the
>   beginning of the function
> - Use $size instead of $1 for clarity in the comparison
> 
>  common/dmlogwrites | 16 ++++++++++++++++
>  1 file changed, 16 insertions(+)
> 
> diff --git a/common/dmlogwrites b/common/dmlogwrites
> index a27e1966..b457ef7f 100644
> --- a/common/dmlogwrites
> +++ b/common/dmlogwrites
> @@ -14,6 +14,22 @@ _require_log_writes()
>  	_require_test_program "log-writes/replay-log"
>  }
>  
> +# Require a log writes device of a minimum size
> +# $1: minimum size in KB
> +_require_log_writes_sized()

Makes sense to me. Although I think we can support 'size checking' in original
_require_log_writes helper too, but I don't have objection on this change. Thanks

Reviewed-by: Zorro Lang <zlang@kernel.org>

> +{
> +	local size=$1
> +	local devsize
> +
> +	[ $# -eq 1 ] || _fail "_require_log_writes_sized: expected size param"
> +
> +	_require_log_writes
> +
> +	devsize=$(_get_device_size $LOGWRITES_DEV)
> +	[ $devsize -lt $size ] && \
> +		_notrun "LOGWRITES_DEV too small, ${devsize}KB < ${size}KB"
> +}
> +
>  # 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
> -- 
> 2.45.1
> 

      parent reply	other threads:[~2026-05-11 14:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-08 14:47 [PATCH v3 1/2] common/dmlogwrites: add _require_log_writes_sized helper Disha Goel
2026-05-08 14:47 ` [PATCH v3 2/2] btrfs/291: fix state transition logic and add size requirement Disha Goel
2026-05-11 15:20   ` Zorro Lang
2026-05-11 14:31 ` Zorro Lang [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=agHm1zCSzmZ1DL4a@zlang-mailbox \
    --to=zlang@kernel.org \
    --cc=anajain.sg@gmail.com \
    --cc=disgoel@linux.ibm.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 \
    /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