All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: Andrea Cervesato <andrea.cervesato@suse.de>
Cc: Linux Test Project <ltp@lists.linux.it>
Subject: Re: [LTP] [PATCH v3 1/2] fallocate01: Convert to new API
Date: Wed, 26 Aug 2026 17:23:35 +0200	[thread overview]
Message-ID: <ao8E9xmRqH35vJrz@yuki.lan> (raw)
In-Reply-To: <20260826-convert_fallocate_suite-v3-1-1286ede0493d@suse.com>

Hi!
> -void populate_files(int fd)
> -{
> -	char buf[buf_size + 1];
> -	int index;
> -	int blocks;
> -	int data;
> +	TEST(fallocate(fd, 0, 0, block_size));
> +	if (TST_RET != 0) {
> +		if (TST_ERR == EOPNOTSUPP || TST_ERR == ENOSYS)
> +			tst_brk(TCONF, "fallocate() not supported");

Sigh, looks like we need separate checks for fallocate() with and
without FALLOC_FL_KEEP_SIZE:

tst_test.c:1986: TINFO: === Testing on exfat ===
tst_test.c:1291: TINFO: Formatting /dev/loop0 with exfat opts='' extra opts=''
tst_test.c:1303: TINFO: Mounting /dev/loop0 to /tmp/LTP_falpgaoah/mntpoint fstyp=exfat flags=0
fallocate01.c:92: TPASS: fallocate(DEFAULT_MODE, 393216, 32768) passed
fallocate01.c:97: TPASS: file_stat.st_size == expected_size (425984)
fallocate01.c:101: TPASS: pos == offset + write_offset (409600)
fallocate01.c:103: TPASS: write into the newly allocated region returned 1
fallocate01.c:92: TFAIL: fallocate(FALLOC_FL_KEEP_SIZE, 393216, 32768) failed: EOPNOTSUPP (95)
fallocate01.c:97: TPASS: file_stat.st_size == expected_size (393216)
fallocate01.c:101: TPASS: pos == offset + write_offset (409600)
fallocate01.c:103: TPASS: write into the newly allocated region returned 1


I guess that the easiest solution is to use
TST_EXP_PASS_OR_FAIL(..., EOPNOTSUPP, ...) in the run() function
instead.

-- 
Cyril Hrubis
chrubis@suse.cz

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

  parent reply	other threads:[~2026-08-26 15:24 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 [this message]
2026-08-27  7:43     ` Andrea Cervesato via ltp
2026-08-27  8:09       ` Cyril Hrubis
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=ao8E9xmRqH35vJrz@yuki.lan \
    --to=chrubis@suse.cz \
    --cc=andrea.cervesato@suse.de \
    --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.