From: Petr Vorel <pvorel@suse.cz>
To: Martin Doucha <mdoucha@suse.cz>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH 1/2] fallocate05: Check that deallocated file range is marked as a hole
Date: Fri, 6 Sep 2024 10:17:54 +0200 [thread overview]
Message-ID: <20240906081754.GB985598@pevik> (raw)
In-Reply-To: <20240905134502.33759-1-mdoucha@suse.cz>
Hi Martin,
> The new lseek(SEEK_HOLE/SEEK_DATA) checks will be useful for diagnosing
> why the final write() check fails with ENOSPC. If the hole doesn't get
> created at all, the lseek() checks will fail.
Thank you!
...
> + /* Check that the deallocated file range is marked as a hole */
> + TEST(lseek(fd, 0, SEEK_HOLE));
> +
> + if (TST_RET == 0) {
> + tst_res(TPASS, "Test file contains hole at offset 0");
> + } else if (TST_RET == -1) {
> + tst_res(TFAIL | TTERRNO, "lseek(SEEK_HOLE) failed");
> + } else {
> + tst_res(TFAIL | TTERRNO,
> + "Unexpected lseek(SEEK_HOLE) return value %ld",
> + TST_RET);
> + }
nit: maybe just using SAFE_LSEEK()?
> +
> + TEST(lseek(fd, 0, SEEK_DATA));
> +
> + if (TST_RET == holesize) {
> + tst_res(TPASS, "Test file data start at offset %ld", TST_RET);
> + } else if (TST_RET == -1) {
> + tst_res(TFAIL | TTERRNO, "lseek(SEEK_DATA) failed");
> + } else {
> + tst_res(TFAIL | TTERRNO,
> + "Unexpected lseek(SEEK_DATA) return value %ld",
> + TST_RET);
> + }
nit: and here just:
TEST(SAFE_LSEEK(fd, 0, SEEK_DATA));
if (TST_RET == holesize)
tst_res(TPASS, "Test file data start at offset %ld", TST_RET);
Whatever you choose, LGTM.
Reviewed-by: Petr Vorel <pvorel@suse.cz>
Kind regards,
Petr
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2024-09-06 8:18 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-05 13:44 [LTP] [PATCH 1/2] fallocate05: Check that deallocated file range is marked as a hole Martin Doucha
2024-09-05 13:45 ` [LTP] [PATCH 2/2] fallocate05: Deallocate whole file on bcachefs Martin Doucha
2024-09-06 3:18 ` Li Wang
2024-09-06 8:02 ` Petr Vorel
2024-09-06 8:02 ` Petr Vorel
2024-09-06 10:12 ` Kent Overstreet
2024-09-06 10:12 ` Kent Overstreet
2024-09-10 2:39 ` Li Wang
2024-09-06 1:53 ` [LTP] [PATCH 1/2] fallocate05: Check that deallocated file range is marked as a hole Li Wang
2024-09-06 8:17 ` Petr Vorel [this message]
2024-09-06 8:28 ` Martin Doucha
2024-09-06 8:36 ` Petr Vorel
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=20240906081754.GB985598@pevik \
--to=pvorel@suse.cz \
--cc=ltp@lists.linux.it \
--cc=mdoucha@suse.cz \
/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.