From: Eric Paris <eparis@redhat.com>
To: Lino Sanfilippo <LinoSanfilippo@gmx.de>
Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH] fanotify: correct broken ref counting in case adding a mark failed
Date: Tue, 09 Nov 2010 15:21:11 -0500 [thread overview]
Message-ID: <1289334071.3083.29.camel@localhost.localdomain> (raw)
In-Reply-To: <20101109171816.GB14516@lsanfilippo.unix.rd.tt.avira.com>
On Tue, 2010-11-09 at 18:18 +0100, Lino Sanfilippo wrote:
> If adding a mount or inode mark failed fanotify_free_mark() is called explicitly.
> But at this time the mark has already been put into the destroy list of the
> fsnotify_mark kernel thread. If the thread is too slow it will try to decrease
> the reference of a mark, that has already been freed by fanotify_free_mark().
> (If its fast enough it will only decrease the marks ref counter from 2 to 1 - note
> that the counter has been increased to 2 in add_mark() - which has practically no
> effect.)
> This patch fixes the ref counting by not calling free_mark() explicitly, but
> decreasing the ref counter and rely on the fsnotify_mark thread to cleanup in
> case adding the mark has failed.
>
> Signed-off-by: Lino Sanfilippo <LinoSanfilippo@gmx.de>
applied to http://git.infradead.org/users/eparis/notify.git/ #for-next
-Eric
prev parent reply other threads:[~2010-11-09 20:21 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-09 17:18 [PATCH] fanotify: correct broken ref counting in case adding a mark failed Lino Sanfilippo
2010-11-09 20:21 ` Eric Paris [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=1289334071.3083.29.camel@localhost.localdomain \
--to=eparis@redhat.com \
--cc=LinoSanfilippo@gmx.de \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@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).