From: Ritesh Harjani <ritesh.list@gmail.com>
To: Ojaswin Mujoo <ojaswin@linux.ibm.com>
Cc: fstests@vger.kernel.org, riteshh@linux.ibm.com,
linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] common/rc: Modify _require_batched_discard to improve test coverage
Date: Fri, 1 Apr 2022 15:24:36 +0530 [thread overview]
Message-ID: <20220401095436.oxdq2duhuudx2c4r@riteshh-domain> (raw)
In-Reply-To: <20220401055713.634842-1-ojaswin@linux.ibm.com>
On 22/04/01 11:27AM, Ojaswin Mujoo wrote:
> A recent ext4 patch discussed [1] that some devices (eg LVMs) can
> have a discard granularity as big as 42MB which makes it larger
> than the group size of ext4 FS with 1k BS. This causes the FITRIM
> IOCTL to fail on filesystems like ext4.
>
> This case was not correctly handle by "_require_batched_discard" as
> it incorrectly interpreted the FITRIM failure as fs not supporting
> the IOCTL. This caused the tests like generic/260 to incorectly
> report "not run" instead of "failed" in case of large discard
> granularity.
Ok, I looked at fstrim code and it does print [1]
"the discard operation is not supported" in case of rc == 1.
And if rc != 0 it will always returns EXIT_FAILURE.
So this patch looks good to me. Feel free to add:
Reviewed-by: Ritesh Harjani <riteshh@linux.ibm.com>
Although it will be good to check if we can add a generic test case
using maybe lvm or dm device, where this device could report large
discard_granularity for actually excercising this code path
(rather then changing kernel code to test it).
-ritesh
[1]: https://github.com/util-linux/util-linux/blob/master/sys-utils/fstrim.c
>
> Fix "_require_batched_discard" to use a more accurate method
> to determine if discard is supported.
>
> [1] commit 173b6e383d2
> ext4: avoid trim error on fs with small groups
>
> Signed-off-by: Ojaswin Mujoo <ojaswin@linux.ibm.com>
> ---
> common/rc | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)
>
next prev parent reply other threads:[~2022-04-01 9:54 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-01 5:57 [PATCH] common/rc: Modify _require_batched_discard to improve test coverage Ojaswin Mujoo
2022-04-01 9:54 ` Ritesh Harjani [this message]
2022-04-03 8:19 ` Ojaswin Mujoo
2022-05-09 6:22 ` Ojaswin Mujoo
2022-05-10 6:32 ` Zorro Lang
2022-05-10 11:49 ` 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=20220401095436.oxdq2duhuudx2c4r@riteshh-domain \
--to=ritesh.list@gmail.com \
--cc=fstests@vger.kernel.org \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ojaswin@linux.ibm.com \
--cc=riteshh@linux.ibm.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