From: Petr Vorel <pvorel@suse.cz>
To: Andrea Cervesato <andrea.cervesato@suse.de>
Cc: Sebastian Chlad <schlad@suse.de>, ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v2 1/2] Fix unlink09 test
Date: Wed, 19 Jun 2024 17:50:13 +0200 [thread overview]
Message-ID: <20240619155013.GA474490@pevik> (raw)
In-Reply-To: <20240605-unlink09-v2-1-bfa0bbdc8753@suse.com>
Hi Andrea,
> This patch will fix unlink09 test by checking for filesystems which
> are not supporting inode attributes. At the same time, it removes the
> read-only filesystem unlink() check in order to add .all_filesystems
> support.
...
> - TST_EXP_FAIL(unlink(tc->filename), tc->expected_errno, "%s", tc->desc);
> + TST_EXP_FAIL(unlink(tc->filename), EPERM, "%s", tc->desc);
> /* If unlink() succeeded unexpectedly, test file should be restored. */
> if (!TST_RET) {
> - if (tc->fd) {
> - *(tc->fd) = SAFE_OPEN(tc->filename, O_CREAT, 0600);
> - if (tc->flag) {
> - SAFE_IOCTL(*(tc->fd), FS_IOC_GETFLAGS, &attr);
> - attr |= tc->flag;
> - SAFE_IOCTL(*(tc->fd), FS_IOC_SETFLAGS, &attr);
> - }
> - } else {
> - SAFE_TOUCH(tc->filename, 0600, 0);
> - }
> + *(tc->fd) = SAFE_CREAT(tc->filename, 0600);
FYI, when forcing NTFS, we get EINVAL, reported by Avinesh:
LTP_SINGLE_FS_TYPE=ntfs ./unlink09
tst_test.c:1120: TINFO: Mounting /dev/loop2 to /tmp/LTP_unlqPsIkB/mnt fstyp=ntfs flags=0
tst_test.c:1120: TINFO: Trying FUSE...
unlink09.c:73: TBROK: ioctl(3,((((1U) << (((0+8)+8)+14)) | ((('f')) << (0+8)) | (((2)) << 0) | ((((sizeof(long)))) << ((0+8)+8)))),...) failed: EINVAL (22)
unlink09.c:42: TWARN: ioctl(3,((((2U) << (((0+8)+8)+14)) | ((('f')) << (0+8)) | (((1)) << 0) | ((((sizeof(long)))) << ((0+8)+8)))),...) failed: EINVAL (22)
unlink09.c:49: TWARN: ioctl(3,((((1U) << (((0+8)+8)+14)) | ((('f')) << (0+8)) | (((2)) << 0) | ((((sizeof(long)))) << ((0+8)+8)))),...) failed: EINVAL (22)
I tried SAFE_OPEN with O_RDWR | O_CREAT (patch from Avinesh), but it did not help.
https://lore.kernel.org/ltp/20240603124653.31967-1-akumar@suse.de/
https://patchwork.ozlabs.org/project/ltp/patch/20240601195149.17570-1-akumar@suse.de/
It's not ENOTTY, thus it's not checked by inode attributes check.
> + setup_inode_flag(*(tc->fd), tc->flag, 0);
> }
> }
> @@ -96,7 +101,8 @@ static struct tst_test test = {
> .tcnt = ARRAY_SIZE(tcases),
> .cleanup = cleanup,
> .test = verify_unlink,
> - .needs_rofs = 1,
> - .mntpoint = DIR_EROFS,
> + .mntpoint = MNTPOINT,
> .needs_root = 1,
> + .all_filesystems = 1,
> + .format_device = 1,
Test fails on exfat (on various kernel versions):
tst_test.c:1694: TINFO: === Testing on exfat ===
tst_test.c:1107: TINFO: Formatting /dev/loop0 with exfat opts='' extra opts=''
tst_test.c:1121: TINFO: Mounting /dev/loop0 to /tmp/LTP_unl7cHxvL/mnt fstyp=exfat flags=0
unlink09.c:69: TBROK: Inode attributes not supported by 'exfat'
i.e. different error than on ntfs, but the same as on vfat (which is also
disabled). I wonder why NTFS is different. Or is it fuse relevant?
With added exfat LGTM (I can change this before merge.
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-06-19 15:51 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-05 14:40 [LTP] [PATCH v2 0/2] Fix unlink09 test Andrea Cervesato
2024-06-05 14:40 ` [LTP] [PATCH v2 1/2] " Andrea Cervesato
2024-06-19 15:50 ` Petr Vorel [this message]
2024-06-05 14:40 ` [LTP] [PATCH v2 2/2] Add unlink10 test Andrea Cervesato
2024-06-06 22:10 ` Wei Gao via ltp
2024-06-06 22:59 ` Wei Gao via ltp
2024-06-19 16:05 ` 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=20240619155013.GA474490@pevik \
--to=pvorel@suse.cz \
--cc=andrea.cervesato@suse.de \
--cc=ltp@lists.linux.it \
--cc=schlad@suse.de \
/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