All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrea Cervesato via ltp <ltp@lists.linux.it>
To: "Cyril Hrubis" <chrubis@suse.cz>
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 07:43:32 +0000	[thread overview]
Message-ID: <6a8feaa4.c69142e7.26d8ab.d0a0@mx.google.com> (raw)
In-Reply-To: <ao8E9xmRqH35vJrz@yuki.lan>

> 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.

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()

--
Andrea Cervesato
SUSE QE Automation Engineer Linux
andrea.cervesato@suse.com

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

  reply	other threads:[~2026-08-27  7:44 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 [this message]
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=6a8feaa4.c69142e7.26d8ab.d0a0@mx.google.com \
    --to=ltp@lists.linux.it \
    --cc=andrea.cervesato@suse.com \
    --cc=chrubis@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.