From: Amir Goldstein <amir73il@gmail.com>
To: Jan Kara <jack@suse.cz>
Cc: linux-fsdevel <linux-fsdevel@vger.kernel.org>
Subject: Re: [PATCH 1/2] dnotify: Handle errors from fsnotify_add_mark_locked() in fcntl_dirnotify()
Date: Tue, 31 Oct 2017 18:28:26 +0200 [thread overview]
Message-ID: <CAOQ4uxi=73J0M+HynfECyXGk_JWV_wn3ffwKJSiM11maBR77Hg@mail.gmail.com> (raw)
In-Reply-To: <20171031161510.GE26128@quack2.suse.cz>
On Tue, Oct 31, 2017 at 6:15 PM, Jan Kara <jack@suse.cz> wrote:
> On Tue 31-10-17 16:45:57, Jan Kara wrote:
>> On Tue 31-10-17 14:11:49, Amir Goldstein wrote:
>> > On Tue, Oct 31, 2017 at 11:33 AM, Jan Kara <jack@suse.cz> wrote:
>> > > Signed-off-by: Jan Kara <jack@suse.cz>
>> > > ---
>> > > fs/notify/dnotify/dnotify.c | 5 ++++-
>> > > 1 file changed, 4 insertions(+), 1 deletion(-)
>> > >
>> > > diff --git a/fs/notify/dnotify/dnotify.c b/fs/notify/dnotify/dnotify.c
>> > > index cba328315929..a50183bd0ab9 100644
>> > > --- a/fs/notify/dnotify/dnotify.c
>> > > +++ b/fs/notify/dnotify/dnotify.c
>> > > @@ -319,7 +319,9 @@ int fcntl_dirnotify(int fd, struct file *filp, unsigned long arg)
>> > > dn_mark = container_of(fsn_mark, struct dnotify_mark, fsn_mark);
>> > > spin_lock(&fsn_mark->lock);
>> > > } else {
>> > > - fsnotify_add_mark_locked(new_fsn_mark, inode, NULL, 0);
>> > > + error = fsnotify_add_mark_locked(new_fsn_mark, inode, NULL, 0);
>> > > + if (error)
>> > > + goto out_err;
>> >
>> > out_err is not unlocking dnotify_group->mark_mutex, and probably need to
>> > put fsn_mark as well?
>>
>> Argh, good point about mark_mutex (I wonder how come this didn't deadlock
>> when I've tested it). You don't need to put fsn_mark - that is guaranteed
>> to be NULL here.
>
> Attached is a new version of the patch.
Reviewed-by: Amir Goldstein <amir73il@gmail.com>
next prev parent reply other threads:[~2017-10-31 16:28 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-31 9:33 [PATCH 0/2] dnotify: Fix ENOMEM handling Jan Kara
2017-10-31 9:33 ` [PATCH 1/2] dnotify: Handle errors from fsnotify_add_mark_locked() in fcntl_dirnotify() Jan Kara
2017-10-31 12:11 ` Amir Goldstein
2017-10-31 15:45 ` Jan Kara
2017-10-31 16:15 ` Jan Kara
2017-10-31 16:28 ` Amir Goldstein [this message]
2017-10-31 9:33 ` [PATCH 2/2] fsnotify: Protect bail out path of fsnotify_add_mark_locked() properly Jan Kara
2017-10-31 12:26 ` Amir Goldstein
2017-10-31 12:50 ` Greg KH
2017-10-31 12:57 ` Amir Goldstein
2017-10-31 13:40 ` Greg KH
2017-10-31 16:10 ` Jan Kara
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='CAOQ4uxi=73J0M+HynfECyXGk_JWV_wn3ffwKJSiM11maBR77Hg@mail.gmail.com' \
--to=amir73il@gmail.com \
--cc=jack@suse.cz \
--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 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.