From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: Amir Goldstein <amir73il@gmail.com>
Cc: Eryu Guan <guaneryu@gmail.com>,
linux-xfs <linux-xfs@vger.kernel.org>,
fstests <fstests@vger.kernel.org>
Subject: Re: [PATCH 2/2] generic: check the behavior of programs opening a lot of O_TMPFILE files
Date: Tue, 12 Feb 2019 20:33:41 -0800 [thread overview]
Message-ID: <20190213043341.GA32253@magnolia> (raw)
In-Reply-To: <CAOQ4uxjz=Wp1wg2vmvmTe8g69qzN2FF_+nJ=FJZkTsNPMPLCvA@mail.gmail.com>
On Tue, Feb 12, 2019 at 04:42:21AM +0200, Amir Goldstein wrote:
> On Tue, Feb 12, 2019 at 4:18 AM Darrick J. Wong <darrick.wong@oracle.com> wrote:
> >
> > From: Darrick J. Wong <darrick.wong@oracle.com>
> >
> > Create a test (+ helper program) that opens as many unlinked files as it
> > possibly can on the scratch filesystem, then closes all the files at
> > once to stress-test unlinked file cleanup. Add an xfs-specific test to
> > make sure that the fallback code doesn't bitrot.
> >
> > Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> > ---
> > src/Makefile | 2 -
> > src/tmpfile.c | 127 +++++++++++++++++++++++++++++++++++++++++++++++++
> > tests/generic/710 | 65 +++++++++++++++++++++++++
> > tests/generic/710.out | 2 +
> > tests/generic/711 | 73 ++++++++++++++++++++++++++++
> > tests/generic/711.out | 2 +
> > tests/generic/group | 2 +
> > tests/xfs/736 | 71 +++++++++++++++++++++++++++
> > tests/xfs/736.out | 2 +
> > tests/xfs/737 | 79 ++++++++++++++++++++++++++++++
> > tests/xfs/737.out | 2 +
> > tests/xfs/group | 2 +
> > 12 files changed, 428 insertions(+), 1 deletion(-)
> > create mode 100644 src/tmpfile.c
> > create mode 100755 tests/generic/710
> > create mode 100644 tests/generic/710.out
> > create mode 100755 tests/generic/711
> > create mode 100644 tests/generic/711.out
> > create mode 100755 tests/xfs/736
> > create mode 100644 tests/xfs/736.out
> > create mode 100755 tests/xfs/737
> > create mode 100644 tests/xfs/737.out
> >
> >
> > diff --git a/src/Makefile b/src/Makefile
> > index 41826585..5fce881d 100644
> > --- a/src/Makefile
> > +++ b/src/Makefile
> > @@ -27,7 +27,7 @@ LINUX_TARGETS = xfsctl bstat t_mtab getdevicesize preallo_rw_pattern_reader \
> > renameat2 t_getcwd e4compact test-nextquota punch-alternating \
> > attr-list-by-handle-cursor-test listxattr dio-interleaved t_dir_type \
> > dio-invalidate-cache stat_test t_encrypted_d_revalidate \
> > - attr_replace_test swapon mkswap
> > + attr_replace_test swapon mkswap tmpfile
> >
> > SUBDIRS = log-writes perf
> >
> > diff --git a/src/tmpfile.c b/src/tmpfile.c
>
> Let's go crazy and call it t_open_tmpfiles ?
> Missing .gitignore patch.
Will fix.
> ...
> > +/* Put an opened file on the unlinked list and leak the fd. */
> > +void leak_tmpfile(void)
> > +{
> > + int fd = -1;
> > + int ret;
> > +
> > + /* Try to create an O_TMPFILE and leak the fd. */
> > +#ifdef O_TMPFILE
> > + fd = open(".", O_TMPFILE | O_RDWR, 0644);
>
> Pass in path as argv[1], so you won't need to cd $SCRATCH_MNT
> all the time. Or does it have a purpose?
Nope, just sillyness on my part. Thanks for the suggestion.
--D
> Thanks,
> Amir.
next prev parent reply other threads:[~2019-02-13 4:33 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-12 2:17 [PATCH 0/2] fstests: incore unlinked list Darrick J. Wong
2019-02-12 2:17 ` [PATCH 1/2] inject: skip tests when knob dir exists but knob doesn't Darrick J. Wong
2019-02-12 14:03 ` Brian Foster
2019-02-12 2:17 ` [PATCH 2/2] generic: check the behavior of programs opening a lot of O_TMPFILE files Darrick J. Wong
2019-02-12 2:42 ` Amir Goldstein
2019-02-13 4:33 ` Darrick J. Wong [this message]
2019-02-12 14:04 ` Brian Foster
2019-02-13 4:51 ` Darrick J. Wong
2019-02-13 5:11 ` Darrick J. Wong
2019-02-13 15:44 ` Brian Foster
2019-02-13 15:44 ` Brian Foster
2019-02-13 16:20 ` Darrick J. Wong
2019-02-13 16:36 ` Brian Foster
2019-02-13 20:49 ` [PATCH v2 " Darrick J. Wong
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=20190213043341.GA32253@magnolia \
--to=darrick.wong@oracle.com \
--cc=amir73il@gmail.com \
--cc=fstests@vger.kernel.org \
--cc=guaneryu@gmail.com \
--cc=linux-xfs@vger.kernel.org \
/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