From: Petr Vorel <pvorel@suse.cz>
To: Avinesh Kumar <avinesh.kumar@suse.com>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH] syscalls/ioctl_loop0[23]: TCONF when LOOP_CHANGE_FD is not supported
Date: Fri, 6 Nov 2026 09:58:15 +0100 [thread overview]
Message-ID: <20261106085815.GA561900@pevik> (raw)
In-Reply-To: <20261104221453.1076748-1-avinesh.kumar@suse.com>
Hi Avinesh,
> LOOP_CHANGE_FD was removed by d4fabede1da0 ("loop: remove support for
> swapping loop fds") n v7.4-rc1 and it fails with EOPNOTSUPP.
> ioctl_loop02.c:85: TFAIL: LOOP_CHANGE_FD failed: EOPNOTSUPP (95)
> ioctl_loop02.c:97: TFAIL: LOOP_CHANGE_FD failed expected EINVAL got: EOPNOTSUPP (95)
> ioctl_loop03.c:34: TFAIL: LOOP_CHANGE_FD failed expected EINVAL got: EOPNOTSUPP (95)
> Report TCONF for these checks.
Thanks, merged!
> - TEST(ioctl(dev_fd, LOOP_CHANGE_FD, file_fd_invalid));
> - if (TST_RET) {
> - if (TST_ERR == EINVAL)
> - tst_res(TPASS | TTERRNO, "LOOP_CHANGE_FD failed as expected");
> - else
> - tst_res(TFAIL | TTERRNO, "LOOP_CHANGE_FD failed expected EINVAL got");
> - } else {
> - tst_res(TFAIL, "LOOP_CHANGE_FD succeeded");
> + TEST(ioctl(dev_fd, LOOP_CHANGE_FD, file_change_fd));
> + if (TST_RET) {
> + tst_res(TFAIL | TTERRNO, "LOOP_CHANGE_FD failed");
> + } else {
> + tst_res(TPASS, "LOOP_CHANGE_FD succeeded");
> + TST_ASSERT_INT(loop_ro_path, 1);
> + TST_ASSERT_STR(backing_path, backing_file_change_path);
> + }
> +
> + TEST(ioctl(dev_fd, LOOP_CHANGE_FD, file_fd_invalid));
> + if (TST_RET) {
> + if (TST_ERR == EINVAL)
> + tst_res(TPASS | TTERRNO, "LOOP_CHANGE_FD failed as expected");
> + else
> + tst_res(TFAIL | TTERRNO, "LOOP_CHANGE_FD failed expected EINVAL got");
> + } else {
> + tst_res(TFAIL, "LOOP_CHANGE_FD succeeded");
> + }
> }
> SAFE_CLOSE(file_fd);
> @@ -134,6 +140,13 @@ static void setup(void)
> tst_res(TINFO | TERRNO, "LOOP_CONFIGURE is not supported");
> loop_configure_sup = 0;
> }
> +
> + ret = ioctl(dev_fd, LOOP_CHANGE_FD, -1);
> + if (ret && errno == EOPNOTSUPP) {
> + tst_res(TINFO | TERRNO, "LOOP_CHANGE_FD is not supported");
I dared to remove this TINFO | TERRNO message. Since there is only one errno,
it's not important to print it, later TCONF is enough.
Kind regards,
Petr
> + loop_change_fd_sup = 0;
> + }
--
Mailing list info: https://lists.linux.it/listinfo/ltp
prev parent reply other threads:[~2026-11-06 8:58 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-04 22:14 [LTP] [PATCH] syscalls/ioctl_loop0[23]: TCONF when LOOP_CHANGE_FD is not supported Avinesh Kumar via ltp
2026-11-05 0:38 ` [LTP] " linuxtestproject.agent
2026-11-06 8:58 ` Petr Vorel [this message]
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=20261106085815.GA561900@pevik \
--to=pvorel@suse.cz \
--cc=avinesh.kumar@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox