public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: Petr Vorel <pvorel@suse.cz>
Cc: Richard Palethorpe <rpalethorpe@suse.com>, ltp@lists.linux.it
Subject: Re: [LTP] [PATCH 3/3] libltpswap: TCONF on EPERM
Date: Fri, 8 Dec 2023 17:02:51 +0100	[thread overview]
Message-ID: <ZXM-KwDvvNOpm64O@yuki> (raw)
In-Reply-To: <20231011160822.578637-4-pvorel@suse.cz>

Hi!
> +		if (fibmap == 1) {
> +			if (errno == EINVAL)
> +				tst_brk(TCONF, "Swapfile on %s not implemented", fstype);
> +			if (errno == EPERM)
> +				tst_brk(TCONF, "No permission for swapon() on %s", fstype);

I'm not sure if we actually need to print the filesystem type in the
case that we do not have a permission to do swapon.

Also this kind of works because the fibmap ioctl() fails as well,
however I guess that this should really be:

	if (errno == EPERM)
		tst_brk(TCONF, "Permission denied for swapon()");
	else if (fibmap == 1 && errno == EINVAL)
		tst_brk(TCONF, "Swapfile on %s not implemented", fstype);
	else
		tst_brk(TFAIL | TTERNO, ...);

> +		} else {
>  			tst_brk(TFAIL | TTERRNO, "swapon on %s failed", fstype);
> +		}
>  	}
>  
>  	TEST(tst_syscall(__NR_swapoff, filename, 0));
> -- 
> 2.42.0
> 

-- 
Cyril Hrubis
chrubis@suse.cz

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

  reply	other threads:[~2023-12-08 16:02 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-11 16:08 [LTP] [PATCH 0/3] Cleanup tst_ioctl.c, libswap.c Petr Vorel
2023-10-11 16:08 ` [LTP] [PATCH 1/3] tst_ioctl: Cleanup the code Petr Vorel
2023-12-08 15:48   ` Cyril Hrubis
2023-12-10 16:22     ` Petr Vorel
2023-10-11 16:08 ` [LTP] [PATCH 2/3] tst_fs.h: Improve tst_fibmap() doc Petr Vorel
2024-01-19 11:20   ` Cyril Hrubis
2024-01-19 13:15     ` Petr Vorel
2023-10-11 16:08 ` [LTP] [PATCH 3/3] libltpswap: TCONF on EPERM Petr Vorel
2023-12-08 16:02   ` Cyril Hrubis [this message]
2023-12-10 16:24     ` Petr Vorel
2023-12-11  5:28     ` Petr Vorel
2023-10-11 16:18 ` [LTP] [PATCH 0/3] Cleanup tst_ioctl.c, libswap.c Marius Kittler

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=ZXM-KwDvvNOpm64O@yuki \
    --to=chrubis@suse.cz \
    --cc=ltp@lists.linux.it \
    --cc=pvorel@suse.cz \
    --cc=rpalethorpe@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