All of lore.kernel.org
 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 1/1] fsconfig03: Skip on FUSE
Date: Wed, 29 Mar 2023 07:58:50 -0400	[thread overview]
Message-ID: <20230329115850.GA28443@localhost> (raw)
In-Reply-To: <20230328144031.791212-1-pvorel@suse.cz>

On Tue, Mar 28, 2023 at 04:40:31PM +0200, Petr Vorel wrote:
> fsconfig03 is broken not only on vfat and ntfs, but also over FUSE:
> 
> tst_supported_fs_types.c:120: TINFO: FUSE does support exfat

I have a question on function has_kernel_support.

If has_kernel_support start check exfat file system, if exfat not exist then start
check fuse, i have no idea why we still need check fuse, i suppose directly
return "exfat not support" instead of "FUSE does support exfat".

static enum tst_fs_impl has_kernel_support(const char *fs_type)
{
...
        snprintf(template, sizeof(template), "%s/mountXXXXXX", tmpdir);
        if (!mkdtemp(template))
                tst_brk(TBROK | TERRNO, "mkdtemp(%s) failed", template);

        ret = mount("/dev/zero", template, fs_type, 0, NULL);
        if ((ret && errno != ENODEV) || !ret) {
                if (!ret)
                        tst_umount(template);
                tst_res(TINFO, "Kernel supports %s", fs_type);
                SAFE_RMDIR(template);
                return TST_FS_KERNEL;
        }

        SAFE_RMDIR(template);

        /* Is FUSE supported by kernel? */  /////////start check fuse???
        if (fuse_supported == -1) {
                ret = open("/dev/fuse", O_RDWR);
                if (ret < 0) {
                        fuse_supported = 0;
                } else {
                        fuse_supported = 1;
                        SAFE_CLOSE(ret);



> tst_supported_fs_types.c:55: TINFO: mkfs.exfat does exist
> ...
> tst_test.c:1634: TINFO: === Testing on exfat ===
> tst_test.c:1093: TINFO: Formatting /dev/loop0 with exfat opts='' extra opts=''
> fsconfig03.c:38: TBROK: fsopen() failed: ENODEV (19)
> 
> NOTE: it actually works on vfat which is not over FUSE:
> tst_supported_fs_types.c:90: TINFO: Kernel supports vfat
> tst_supported_fs_types.c:55: TINFO: mkfs.vfat does exist
> ...
> tst_test.c:1634: TINFO: === Testing on vfat ===
> tst_test.c:1093: TINFO: Formatting /dev/loop0 with vfat opts='' extra opts=''
> fsconfig03.c:72: TPASS: kernel seems to be fine on vfat
> 
> Reported-by: Wei Gao <wegao@suse.com>
> Signed-off-by: Petr Vorel <pvorel@suse.cz>
> ---
> Verifying NTFS as kernel module (I'd be surprised if it was not
> working). The setup is the same as for fsconfig01.c (fsconfig02.c is for
> expected errors, thus has less strict requirements).
> 
> Kind regards,
> Petr
> 
>  testcases/kernel/syscalls/fsconfig/fsconfig03.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/testcases/kernel/syscalls/fsconfig/fsconfig03.c b/testcases/kernel/syscalls/fsconfig/fsconfig03.c
> index e891c9f98..0ba5355d3 100644
> --- a/testcases/kernel/syscalls/fsconfig/fsconfig03.c
> +++ b/testcases/kernel/syscalls/fsconfig/fsconfig03.c
> @@ -88,7 +88,7 @@ static struct tst_test test = {
>  	.mntpoint = MNTPOINT,
>  	.all_filesystems = 1,
>  	.taint_check = TST_TAINT_W | TST_TAINT_D,
> -	.skip_filesystems = (const char *const []){"ntfs", "vfat", NULL},
> +	.skip_filesystems = (const char *const []){"fuse", NULL},

I feel you can not skip fuse system since i found following list in LTP:
static const char *const fs_type_whitelist[] = {
        "ext2",
        "ext3",
        "ext4",
        "xfs",
        "btrfs",
        "vfat",
        "exfat",
        "ntfs",
        "tmpfs",
        NULL
};

>  	.tags = (const struct tst_tag[]) {
>  		{"linux-git", "722d94847de29"},
>  		{"CVE", "2022-0185"},
> -- 
> 2.40.0
> 

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

  reply	other threads:[~2023-03-29 11:59 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-28 14:40 [LTP] [PATCH 1/1] fsconfig03: Skip on FUSE Petr Vorel
2023-03-29 11:58 ` Wei Gao via ltp [this message]
2023-03-29 13:38   ` Petr Vorel
2023-03-30 14:14     ` Wei Gao via ltp
2023-03-31 15:34 ` Avinesh Kumar
2023-04-03  5:55   ` 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=20230329115850.GA28443@localhost \
    --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 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.