From: Petr Vorel <pvorel@suse.cz>
To: Amir Goldstein <amir73il@gmail.com>,
Murphy Zhou <jencce.kernel@gmail.com>,
linux-fsdevel <linux-fsdevel@vger.kernel.org>,
Jan Kara <jack@suse.cz>
Subject: Re: [regression] fsnotify fails stress test since fsnotify_for_v5.15-rc1 merged
Date: Thu, 9 Sep 2021 13:14:05 +0200 [thread overview]
Message-ID: <YTnsfdRFofJfIBal@pevik> (raw)
In-Reply-To: <YTnr3gpG44IEjEkf@pevik>
> > On Tue, Sep 7, 2021 at 9:33 AM Murphy Zhou <jencce.kernel@gmail.com> wrote:
> > > Hi,
> > > Since this commit:
> > > commit ec44610fe2b86daef70f3f53f47d2a2542d7094f
> > > Author: Amir Goldstein <amir73il@gmail.com>
> > > Date: Tue Aug 10 18:12:19 2021 +0300
> > > fsnotify: count all objects with attached connectors
> > > Kernel fsnotify can't finish a stress testcase that used to pass quickly.
> > > Kernel hung at umount. Can not be killed but restarting the server.
> > > Reproducer text is attached.
> > Hi Murphy,
> > Thank you for the detailed report.
> > I was able to reproduce the hang and the attached patch fixes it for me.
> > Cloud you please verify the fix yourself as well?
> > This is a good regression test.
> > Did you consider contributing it to LTP?
> > I think the LTP team could also help converting your reproducer to
> > an LTP test (CC: Petr).
> @Murphy: yes, please contribute that to LTP. There are already fanotify tests [1],
> here is the C API [2] and shell API [3] (if needed, it should be enough to write
> it just in C). If you have any questions, don't hesitate ask on LTP ML and Cc
> me.
I see you've contributed to LTP already :).
Kind regards,
Petr
> @Amir: thanks!
> Kind regards,
> Petr
> [1] https://github.com/linux-test-project/ltp/tree/master/testcases/kernel/syscalls/fanotify/
> [2] https://github.com/linux-test-project/ltp/wiki/C-Test-API
> [3] https://github.com/linux-test-project/ltp/wiki/Shell-Test-API
> > Thanks,
> > Amir.
> > From 14d3c313062dfbc86b3d2c4d7deec56a096432f7 Mon Sep 17 00:00:00 2001
> > From: Amir Goldstein <amir73il@gmail.com>
> > Date: Thu, 9 Sep 2021 13:46:34 +0300
> > Subject: [PATCH] fsnotify: fix sb_connectors leak
> > Fix a leak in s_fsnotify_connectors counter in case of a race between
> > concurrent add of new fsnotify mark to an object.
> > The task that lost the race fails to drop the counter before freeing
> > the unused connector.
> > Fixes: ec44610fe2b8 ("fsnotify: count all objects with attached connectors")
> > Reported-by: Murphy Zhou <jencce.kernel@gmail.com>
> > Link: https://lore.kernel.org/linux-fsdevel/20210907063338.ycaw6wvhzrfsfdlp@xzhoux.usersys.redhat.com/
> > Signed-off-by: Amir Goldstein <amir73il@gmail.com>
> > ---
> > fs/notify/mark.c | 1 +
> > 1 file changed, 1 insertion(+)
> > diff --git a/fs/notify/mark.c b/fs/notify/mark.c
> > index 95006d1d29ab..fa1d99101f89 100644
> > --- a/fs/notify/mark.c
> > +++ b/fs/notify/mark.c
> > @@ -531,6 +531,7 @@ static int fsnotify_attach_connector_to_object(fsnotify_connp_t *connp,
> > /* Someone else created list structure for us */
> > if (inode)
> > fsnotify_put_inode_ref(inode);
> > + fsnotify_put_sb_connectors(conn);
> > kmem_cache_free(fsnotify_mark_connector_cachep, conn);
> > }
next prev parent reply other threads:[~2021-09-09 11:14 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-07 6:33 [regression] fsnotify fails stress test since fsnotify_for_v5.15-rc1 merged Murphy Zhou
2021-09-09 11:00 ` Amir Goldstein
2021-09-09 11:11 ` Petr Vorel
2021-09-09 11:14 ` Petr Vorel [this message]
2021-09-10 1:06 ` Murphy Zhou
2021-09-10 1:05 ` Murphy Zhou
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=YTnsfdRFofJfIBal@pevik \
--to=pvorel@suse.cz \
--cc=amir73il@gmail.com \
--cc=jack@suse.cz \
--cc=jencce.kernel@gmail.com \
--cc=linux-fsdevel@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;
as well as URLs for NNTP newsgroup(s).