From: Cyril Hrubis <chrubis@suse.cz>
To: Andrea Cervesato <andrea.cervesato@suse.com>
Cc: Linux Test Project <ltp@lists.linux.it>
Subject: Re: [LTP] [PATCH v3 1/2] fallocate01: Convert to new API
Date: Thu, 27 Aug 2026 10:09:39 +0200 [thread overview]
Message-ID: <ao_wwyjEOo4MVyao@yuki.lan> (raw)
In-Reply-To: <6a8feaa4.c69142e7.26d8ab.d0a0@mx.google.com>
Hi!
> mmmh...I guess we need to keep the gate on ENOSYS and to check for
> ENOTSUPP in here, but we can't use TST_EXP_PASS_OR_FAIL(). That will
> TFAIL on succeed, so I need to use the same test function for both
> setup() and run()
>
> static int test_fallocate(int fd, int mode, long len, long off)
> {
> TEST(fallocate(fd, mode, len, off));
> if (TST_RET != 0) {
> if (TST_ERR == EOPNOTSUPP || TST_ERR == ENOSYS)
> tst_brk(TCONF, "fallocate() not supported");
>
> tst_brk(TBROK | TTERRNO, "fallocate() failed");
> }
>
> return TST_RET;
> }
>
> and use it into setup() + run() with TST_EXP_PASS()
We can handle ENOSYS in the test setup(). ENOSYS means that the syscall
is missing completely. But we can get EOPNOTSUPP for only subset of
flags, this needs to be handled in run().
--
Cyril Hrubis
chrubis@suse.cz
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2026-08-27 8:09 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-26 13:34 [LTP] [PATCH v3 0/2] Convert fallocate testing suite Andrea Cervesato
2026-08-26 13:34 ` [LTP] [PATCH v3 1/2] fallocate01: Convert to new API Andrea Cervesato
2026-08-26 13:36 ` Andrea Cervesato via ltp
2026-08-26 15:23 ` Cyril Hrubis
2026-08-27 7:43 ` Andrea Cervesato via ltp
2026-08-27 8:09 ` Cyril Hrubis [this message]
2026-08-27 8:24 ` Andrea Cervesato via ltp
2026-08-26 13:34 ` [LTP] [PATCH v3 2/2] fallocate02: " Andrea Cervesato
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=ao_wwyjEOo4MVyao@yuki.lan \
--to=chrubis@suse.cz \
--cc=andrea.cervesato@suse.com \
--cc=ltp@lists.linux.it \
/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.