[LTP] [PATCH] syscalls: avoid creating whiteout device in tests

Eryu Guan eguan@redhat.com
Fri Dec 11 14:19:04 CET 2015


On Fri, Dec 11, 2015 at 08:00:55AM -0500, Jan Stancek wrote:
> 
> 
> 
> 
> ----- Original Message -----
> > From: "Eryu Guan" <eguan@redhat.com>
> > To: ltp@lists.linux.it
> > Sent: Thursday, 10 December, 2015 12:38:22 PM
> > Subject: [LTP] [PATCH] syscalls: avoid creating whiteout device in tests
> > 
> > A char device with major 0 and minor 0 is known as whiteout device, and
> > overlayfs refuses to create such device. mknod01 and mount02 fail on
> > overlayfs because of this restriction.
> > 
> > Fix it by creating null device instead.
> > 
> > Signed-off-by: Eryu Guan <eguan@redhat.com>
> 
> Hi,
> 
> > ---
> >  testcases/kernel/syscalls/mknod/mknod01.c | 17 +++++++++++++----
> >  testcases/kernel/syscalls/mount/mount02.c |  8 ++++++--
> >  2 files changed, 19 insertions(+), 6 deletions(-)
> > 
> > diff --git a/testcases/kernel/syscalls/mknod/mknod01.c
> > b/testcases/kernel/syscalls/mknod/mknod01.c
> > index 863d02d..a35adf9 100644
> > --- a/testcases/kernel/syscalls/mknod/mknod01.c
> > +++ b/testcases/kernel/syscalls/mknod/mknod01.c
> > @@ -66,6 +66,7 @@ int TST_TOTAL = ARRAY_SIZE(tcases);
> >  int main(int ac, char **av)
> >  {
> >  	int lc, i;
> > +	dev_t dev;
> >  
> >  	tst_parse_opts(ac, av, NULL, NULL);
> >  
> > @@ -75,17 +76,25 @@ int main(int ac, char **av)
> >  		tst_count = 0;
> >  
> >  		for (i = 0; i < TST_TOTAL; i++) {
> > +			/*
> > +			 * overlayfs doesn't support mknod char device with
> > +			 * major 0 and minor 0, which is known as whiteout_dev
> > +			 */
> > +			if (S_ISCHR(tcases[i]))
> > +				dev = makedev(1, 3);
> > +			else
> > +				dev = 0;
> >  			TEST(mknod(PATH, tcases[i], 0));
> 
> Did you mean to use "dev" variable here? ----------^^^

Thanks for the review! Yes, it should be "dev", will send v2 shortly. (I
should generate patch on my test machine, where I test the code, not on
my laptop..)

Thanks,
Eryu


More information about the Ltp mailing list