Re: [PATCH 1/2] dnotify: Handle errors from fsnotify_add_mark_locked() in fcntl_dirnotify()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Oct 31, 2017 at 6:15 PM, Jan Kara <jack@xxxxxxx> 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@xxxxxxx> wrote:
>> > > Signed-off-by: Jan Kara <jack@xxxxxxx>
>> > > ---
>> > >  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@xxxxxxxxx>



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux