All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: Petr Vorel <pvorel@suse.cz>
Cc: Jan Kara <jack@suse.cz>, ltp@lists.linux.it
Subject: Re: [LTP] [PATCH 3/3] fanotify10: Make evictable marks tests more reliable
Date: Tue, 22 Nov 2022 13:42:26 +0100	[thread overview]
Message-ID: <Y3zDsuPkRG3Ms+aP@yuki> (raw)
In-Reply-To: <Y3yk0Im/h5cOCLgx@pevik>

Hi!@
> > > +	for (i = 0; i < max_file_multi; i++) {
> > > +		char path[PATH_MAX];
> > > +
> > > +		sprintf(path, FILE_PATH_MULTIDIR, i);
> > > +		SAFE_UNLINK(path);
> > > +		sprintf(path, DIR_PATH_MULTI, i);
> > > +		SAFE_RMDIR(path);
> > > +		sprintf(path, FILE_PATH_MULTI, i);
> > > +		SAFE_UNLINK(path);
> > > +	}
> > >  	SAFE_UNLINK(FILE_PATH);
> > > -	SAFE_UNLINK(FILE2_PATH);
> > >  	SAFE_RMDIR(SUBDIR_PATH);
> > >  	SAFE_RMDIR(DIR_PATH);
> > >  	SAFE_RMDIR(MNT2_PATH);
> 
> > Do we have to unlink anything at all?
> 
> > As far as I can tell we create these files on a device that is
> > reformatted after the test anyways.
> 
> It looks it's not cleared, because tmpdir is removed in do_cleanup(),
> which is called just before the end of testing, not for each filesystem:
> 
> https://github.com/linux-test-project/ltp/tree/master/lib
> 
> Files created for testing in test's setup() are called for each filesystem
> (do_test_setup), therefore files would remain created:
> 
> fanotify10.c:894: TBROK: mkdir(fs_mnt/testdir, 0755) failed: EEXIST (17)
> 
> Summary:
> passed   492
> failed   0
> broken   1
> skipped  3
> warnings 0
> 
> And even if we disable just SAFE_UNLINK(FILE_PATH); we get errors
> due our rmdir() implementation wanting directory being empty:
> 
> fanotify10.c:953: TWARN: rmdir(fs_mnt/testdir) failed: ENOTEMPTY (39)
> fanotify10.c:894: TBROK: mkdir(fs_mnt/testdir, 0755) failed: EEXIST (17)
> fanotify10.c:952: TWARN: rmdir(fs_mnt/testdir/testdir2) failed: ENOENT (2)
> fanotify10.c:953: TWARN: rmdir(fs_mnt/testdir) failed: ENOTEMPTY (39)
> fanotify10.c:954: TWARN: rmdir(mntpoint) failed: ENOENT (2)
> 
> IMHO it's safer to remove these files instead of creating them just for first
> filesystem. Having unique path for each filesystem (e.g. use filesystem name in
> the directory path would result would solve the need to remove files but
> probably not worth of implementing.

Hmm, I was commenting under an impression that we create all files on
the device and it looks like that is the case, but we do not run with
.all_filesystems but rather than that with .variants = 2 and of course
we call do_test_setup() for each test variant. So yes we run the test
twice with the same device and the cleanup is required.

-- 
Cyril Hrubis
chrubis@suse.cz

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

      reply	other threads:[~2022-11-22 12:41 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-15 12:47 [LTP] [PATCH 0/3] Make fanotify10 test yet more reliable Jan Kara
2022-11-15 12:47 ` [LTP] [PATCH 1/3] fanotify10: Use named initializers Jan Kara
2022-11-15 12:47 ` [LTP] [PATCH 2/3] fanotify10: Add support for multiple event files Jan Kara
2022-11-17 15:58   ` Petr Vorel
2022-11-21  9:14     ` Jan Kara
2022-11-21  9:33       ` Petr Vorel
2022-11-21  9:39         ` Cyril Hrubis
2022-11-22  8:19           ` Petr Vorel
2022-11-22 10:10             ` Petr Vorel
2022-11-21  9:53         ` Jan Kara
2022-11-21 14:24           ` Richard Palethorpe
2022-11-22  8:17             ` Petr Vorel
2022-11-22  8:57               ` Richard Palethorpe
2022-11-21 15:04   ` Cyril Hrubis
2022-11-22 12:10     ` Richard Palethorpe
2022-11-22 12:56       ` Cyril Hrubis
2022-11-15 12:47 ` [LTP] [PATCH 3/3] fanotify10: Make evictable marks tests more reliable Jan Kara
2022-11-16  2:17   ` Pengfei Xu
2022-11-16 10:58     ` Jan Kara
2022-11-16 16:32       ` Amir Goldstein
2022-11-17 15:50         ` Petr Vorel
2022-11-21 15:09   ` Cyril Hrubis
2022-11-22 10:30     ` Petr Vorel
2022-11-22 12:42       ` Cyril Hrubis [this message]

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=Y3zDsuPkRG3Ms+aP@yuki \
    --to=chrubis@suse.cz \
    --cc=jack@suse.cz \
    --cc=ltp@lists.linux.it \
    --cc=pvorel@suse.cz \
    /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.