linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Amir Goldstein <amir73il@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: kernel test robot <lkp@intel.com>,
	Linux Memory Management List <linux-mm@kvack.org>,
	Jan Kara <jack@suse.cz>
Subject: Re: [linux-next:master] BUILD REGRESSION 605cbf3d5f20470ec303b79feda3202935f4a142
Date: Fri, 21 Aug 2020 00:03:08 +0300	[thread overview]
Message-ID: <CAOQ4uxhh7-7m1vLd94P67nAXFfPZ2hedyX-KUxuBb-5hBq9ixQ@mail.gmail.com> (raw)
In-Reply-To: <20200820134006.ce03bfbb54650fd99de0f09c@linux-foundation.org>

On Thu, Aug 20, 2020 at 11:40 PM Andrew Morton
<akpm@linux-foundation.org> wrote:
>
> On Fri, 21 Aug 2020 04:26:12 +0800 kernel test robot <lkp@intel.com> wrote:
>
> > tree/branch: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git  master
> > branch HEAD: 605cbf3d5f20470ec303b79feda3202935f4a142  Add linux-next specific files for 20200820
> >
> > Error/Warning in current branch:
> >
> > fs/notify/fsnotify.c:460 fsnotify() warn: variable dereferenced before check 'inode' (see line 449)
>
> Yes, this:
>
> :       if (!inode) {
> :               /* Dirent event - report on TYPE_INODE to dir */
> :               inode = dir;
> :       } else if (mask & FS_EVENT_ON_CHILD) {
> :               /*
> :                * Event on child - report on TYPE_INODE to dir if it is
> :                * watching children and on TYPE_CHILD to child.
> :                */
> :               child = inode;
> :               inode = dir;
> :       }
>
> `inode' is non-NULL here.
>
> :       sb = inode->i_sb;
>
> So this is OK.
>
> :       /*
> :        * Optimization: srcu_read_lock() has a memory barrier which can
> :        * be expensive.  It protects walking the *_fsnotify_marks lists.
> :        * However, if we do not walk the lists, we do not have to do
> :        * SRCU because we have no references to any objects and do not
> :        * need SRCU to keep them "alive".
> :        */
> :       if (!sb->s_fsnotify_marks &&
> :           (!mnt || !mnt->mnt_fsnotify_marks) &&
> :           (!inode || !inode->i_fsnotify_marks) &&
>
> So !inode is always false.
>
> :           (!child || !child->i_fsnotify_marks))
> :               return 0;
>
> I assume we can just zap the "!inode ||".  Amir & Jan, can you
> please take a look?
>

Andrew,

This warning was brought to our attention.
We both agreed that we like the code as it is with the unneeded !inode check.

https://lore.kernel.org/linux-fsdevel/20200730192537.GB13525@quack2.suse.cz/

Thanks,
Amir.


  reply	other threads:[~2020-08-20 21:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-20 20:26 kernel test robot
2020-08-20 20:40 ` Andrew Morton
2020-08-20 21:03   ` Amir Goldstein [this message]
2020-08-20 20:43 ` Andrew Morton
2020-08-23  3:41   ` Philip Li

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=CAOQ4uxhh7-7m1vLd94P67nAXFfPZ2hedyX-KUxuBb-5hBq9ixQ@mail.gmail.com \
    --to=amir73il@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=jack@suse.cz \
    --cc=linux-mm@kvack.org \
    --cc=lkp@intel.com \
    /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