[LTP] [PATCH 3/3] libltpswap: TCONF on EPERM

Petr Vorel pvorel@suse.cz
Sun Dec 10 17:24:57 CET 2023


Hi Cyril,

> 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, ...);

Ah, that's actually better, thanks!
Tomorrow, I'll modify it and merge with your RBT.

Kind regards,
Petr

> > +		} else {
> >  			tst_brk(TFAIL | TTERRNO, "swapon on %s failed", fstype);
> > +		}
> >  	}

> >  	TEST(tst_syscall(__NR_swapoff, filename, 0));
> > -- 
> > 2.42.0


More information about the ltp mailing list