public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Wei Gao via ltp <ltp@lists.linux.it>
To: Petr Vorel <pvorel@suse.cz>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v5 2/2] ioctl_fiemap01: New test for fiemap ioctl()
Date: Thu, 10 Apr 2025 01:31:57 -0400	[thread overview]
Message-ID: <Z/dXzRQsXnXKYYkh@wegao> (raw)
In-Reply-To: <20250227164338.GG3130282@pevik>

On Thu, Feb 27, 2025 at 05:43:38PM +0100, Petr Vorel wrote:
> Hi Wei,
> 
> ...
> 
> > +
> > +	ret = ioctl(fd, FS_IOC_FIEMAP, fiemap);
> > +	if (ret == -1) {
> > +		if (errno == ENOTTY)
> > +			tst_res(TCONF, "ioctl(FS_IOC_FIEMAP) not implemented");
> I wonder if it's safe to put errno == ENOTTY check into SAFE_IOCTL().
> We have similar checks in safe_socket() and other.
> 
> e.g.:
> #define TTYPE (errno == ENOTTY ? TCONF : TBROK)
> 
> Maybe it's not safe, ENOTTY might be caused by some test error which deserves
> TBROK:
> 
>        ENOTTY fd is not associated with a character special device.
> 
>        ENOTTY The specified operation does not apply to the kind of object that the file descriptor fd references.
> 
I remove this code in next version, i have done quick test on our old build such as 12-sp5 , result is pass

susetest:~ # cat /etc/os-release
NAME="SLES"
VERSION="12-SP5"
VERSION_ID="12.5"
PRETTY_NAME="SUSE Linux Enterprise Server 12 SP5"
ID="sles"
ANSI_COLOR="0;32"
CPE_NAME="cpe:/o:suse:sles:12:sp5"
susetest:~ # uname
uname    uname26
susetest:~ # uname -r
4.12.14-122.231-default

> > +
> > +static struct tst_test test = {
> > +	.mount_device = 1,
> > +	.mntpoint = MNTPOINT,
> > +	.all_filesystems = 1,
> > +	.skip_filesystems = (const char *const[]) {
> > +		"exfat", "vfat", "ntfs", "tmpfs", NULL
> 
> Is the function unimplemented on these (even on tmpfs)? I would expect that but
tmpfs is an in-memory filesystem and does not store any file into real disk, so it
not suppose to support it. 
> better to explain in the commit message why it's skipped.
I have done some check on other filesystems such as exfat/vfat/ntfs, it show unsupport
error, still need further investigation if we want figure out root cause, just for
safe reason i skip those filesystem in this case currently.


attach test log:
cat /etc/os-release
NAME="openSUSE Leap"
VERSION="15.5"
ID="opensuse-leap"
ID_LIKE="suse opensuse"
VERSION_ID="15.5"
PRETTY_NAME="openSUSE Leap 15.5"
ANSI_COLOR="0;32"
CPE_NAME="cpe:/o:opensuse:leap:15.5"
BUG_REPORT_URL="https://bugs.opensuse.org"
HOME_URL="https://www.opensuse.org/"
DOCUMENTATION_URL="https://en.opensuse.org/Portal:Leap"
LOGO="distributor-logo-Leap"


tst_kconfig.c:88: TINFO: Parsing kernel config '/proc/config.gz'
tst_kconfig.c:678: TINFO: CONFIG_FAULT_INJECTION kernel option detected which might slow the execution
tst_test.c:1724: TINFO: Overall timeout per run is 0h 02m 00s
tst_supported_fs_types.c:97: TINFO: Kernel supports ext2
tst_supported_fs_types.c:62: TINFO: mkfs.ext2 does exist
tst_supported_fs_types.c:97: TINFO: Kernel supports ext3
tst_supported_fs_types.c:62: TINFO: mkfs.ext3 does exist
tst_supported_fs_types.c:97: TINFO: Kernel supports ext4
tst_supported_fs_types.c:62: TINFO: mkfs.ext4 does exist
tst_supported_fs_types.c:97: TINFO: Kernel supports xfs
tst_supported_fs_types.c:62: TINFO: mkfs.xfs does exist
tst_supported_fs_types.c:97: TINFO: Kernel supports btrfs
tst_supported_fs_types.c:62: TINFO: mkfs.btrfs does exist
tst_supported_fs_types.c:105: TINFO: Skipping bcachefs because of FUSE blacklist
tst_supported_fs_types.c:170: TINFO: Skipping vfat as requested by the test
tst_supported_fs_types.c:170: TINFO: Skipping exfat as requested by the test
tst_supported_fs_types.c:132: TINFO: FUSE does support ntfs
tst_supported_fs_types.c:62: TINFO: mkfs.ntfs does exist
tst_supported_fs_types.c:97: TINFO: Kernel supports tmpfs
tst_supported_fs_types.c:49: TINFO: mkfs is not needed for tmpfs

tst_test.c:1833: TINFO: === Testing on vfat ===
tst_test.c:1170: TINFO: Formatting /dev/loop0 with vfat opts='' extra opts=''
tst_test.c:1183: TINFO: Mounting /dev/loop0 to /tmp/LTP_iocNjlayn/mntpoint fstyp=vfat flags=0
ioctl_fiemap01.c:87: TFAIL: ioctl(fd, FS_IOC_FIEMAP, fiemap) expected EBADR: EOPNOTSUPP (95)
ioctl_fiemap01.c:90: TFAIL: ioctl(fd, FS_IOC_FIEMAP, fiemap) failed: EOPNOTSUPP (95)
tst_test.c:1797: TBROK: Test killed by SIGSEGV!



tst_test.c:1833: TINFO: === Testing on exfat ===
tst_test.c:1170: TINFO: Formatting /dev/loop0 with exfat opts='' extra opts=''
tst_test.c:1183: TINFO: Mounting /dev/loop0 to /tmp/LTP_ioclNusF7/mntpoint fstyp=exfat flags=0
ioctl_fiemap01.c:87: TFAIL: ioctl(fd, FS_IOC_FIEMAP, fiemap) expected EBADR: EOPNOTSUPP (95)
ioctl_fiemap01.c:90: TFAIL: ioctl(fd, FS_IOC_FIEMAP, fiemap) failed: EOPNOTSUPP (95)
tst_test.c:1797: TBROK: Test killed by SIGSEGV!



tst_test.c:1833: TINFO: === Testing on ntfs ===
tst_test.c:1170: TINFO: Formatting /dev/loop0 with ntfs opts='' extra opts=''
The partition start sector was not specified for /dev/loop0 and it could not be obtained automatically.  It has been set to 0.
The number of sectors per track was not specified for /dev/loop0 and it could not be obtained automatically.  It has been set to 0.
The number of heads was not specified for /dev/loop0 and it could not be obtained automatically.  It has been set to 0.
To boot from a device, Windows needs the 'partition start sector', the 'sectors per track' and the 'number of heads' to be set.
Windows will not be able to boot from this device.
tst_test.c:1183: TINFO: Mounting /dev/loop0 to /tmp/LTP_iocGtgwCr/mntpoint fstyp=ntfs flags=0
tst_test.c:1183: TINFO: Trying FUSE...
ioctl_fiemap01.c:87: TFAIL: ioctl(fd, FS_IOC_FIEMAP, fiemap) expected EBADR: EOPNOTSUPP (95)
ioctl_fiemap01.c:90: TFAIL: ioctl(fd, FS_IOC_FIEMAP, fiemap) failed: EOPNOTSUPP (95)
tst_test.c:1797: TBROK: Test killed by SIGSEGV!



tst_test.c:1833: TINFO: === Testing on tmpfs ===
tst_test.c:1170: TINFO: Skipping mkfs for TMPFS filesystem
tst_test.c:1146: TINFO: Limiting tmpfs size to 32MB
tst_test.c:1183: TINFO: Mounting ltp-tmpfs to /tmp/LTP_iocUtSP0X/mntpoint fstyp=tmpfs flags=0
ioctl_fiemap01.c:87: TFAIL: ioctl(fd, FS_IOC_FIEMAP, fiemap) expected EBADR: EOPNOTSUPP (95)
ioctl_fiemap01.c:90: TFAIL: ioctl(fd, FS_IOC_FIEMAP, fiemap) failed: EOPNOTSUPP (95)
tst_test.c:1797: TBROK: Test killed by SIGSEGV!


> 
> Kind regards,
> Petr

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

  reply	other threads:[~2025-04-10  5:32 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-18  5:43 [LTP] [PATCH v1] ioctl_fiemap01: New test for fiemap ioctl() Wei Gao via ltp
2024-01-15 15:23 ` Cyril Hrubis
2024-01-18  7:32 ` [LTP] [PATCH v2] " Wei Gao via ltp
2024-02-28 17:07   ` Petr Vorel
2024-03-29  8:28     ` Wei Gao via ltp
2024-03-29 21:32       ` Petr Vorel
2024-03-31  2:15         ` Wei Gao via ltp
2024-03-31  2:17   ` [LTP] [PATCH v3] " Wei Gao via ltp
2024-04-03  9:28     ` Petr Vorel
2024-04-15 10:17       ` Wei Gao via ltp
2024-04-15 12:17         ` Petr Vorel
2024-04-15 11:46     ` [LTP] [PATCH v4] " Wei Gao via ltp
2024-11-06 10:34       ` Cyril Hrubis
2024-12-12  8:50       ` [LTP] [PATCH v5 0/2] " Wei Gao via ltp
2024-12-12  8:50         ` [LTP] [PATCH v5 1/2] tst_safe_macros.h: Add SAFE_STATVFS Wei Gao via ltp
2025-02-27 16:27           ` Petr Vorel
2025-04-10  5:39             ` Wei Gao via ltp
2024-12-12  8:50         ` [LTP] [PATCH v5 2/2] ioctl_fiemap01: New test for fiemap ioctl() Wei Gao via ltp
2025-02-27 16:43           ` Petr Vorel
2025-04-10  5:31             ` Wei Gao via ltp [this message]
2025-04-10  5:49         ` [LTP] [PATCH v6 0/2] " Wei Gao via ltp
2025-04-10  5:49           ` [LTP] [PATCH v6 1/2] tst_safe_macros.h: Add SAFE_STATVFS Wei Gao via ltp
2025-04-11 13:38             ` Petr Vorel
2025-04-10  5:49           ` [LTP] [PATCH v6 2/2] ioctl_fiemap01: New test for fiemap ioctl() Wei Gao via ltp
2025-04-11 15:40             ` Cyril Hrubis
2025-04-15  1:39           ` [LTP] [PATCH v7 0/2] " Wei Gao via ltp
2025-04-15  1:39             ` [LTP] [PATCH v7 1/2] tst_safe_macros.h: Add SAFE_STATVFS Wei Gao via ltp
2025-04-15  1:39             ` [LTP] [PATCH v7 2/2] ioctl_fiemap01: New test for fiemap ioctl() Wei Gao via ltp
2025-04-14 16:02               ` Cyril Hrubis

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=Z/dXzRQsXnXKYYkh@wegao \
    --to=ltp@lists.linux.it \
    --cc=pvorel@suse.cz \
    --cc=wegao@suse.com \
    /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