public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Lino Sanfilippo <LinoSanfilippo@gmx.de>
To: Fabian Frederick <fabf@skynet.be>, linux-kernel@vger.kernel.org
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Jan Kara <jack@suse.cz>, David Howells <dhowells@redhat.com>,
	Eric Paris <eparis@redhat.com>
Subject: Re: [PATCH 1/1 linux-next] fanotify: fix a lock in fanotify_should_send_event()
Date: Sat, 21 Mar 2015 01:56:30 +0100	[thread overview]
Message-ID: <550CC1BE.5050303@gmx.de> (raw)
In-Reply-To: <1426884968-1747-1-git-send-email-fabf@skynet.be>

Hi,

On 20.03.2015 21:56, Fabian Frederick wrote:
> ltp/fanotify02 was locked since commit 66ba93c0d7fe
> ("fanotify: don't set FAN_ONDIR implicitly on a marks ignored mask")
> 
> Signed-off-by: Fabian Frederick <fabf@skynet.be>
> ---
>  fs/notify/fanotify/fanotify.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/notify/fanotify/fanotify.c b/fs/notify/fanotify/fanotify.c
> index d2f97ec..7b3a50b 100644
> --- a/fs/notify/fanotify/fanotify.c
> +++ b/fs/notify/fanotify/fanotify.c
> @@ -140,8 +140,8 @@ static bool fanotify_should_send_event(struct fsnotify_mark *inode_mark,
>  	}
>  
>  	if (d_is_dir(path->dentry) &&
> -	    !(marks_mask & FS_ISDIR & ~marks_ignored_mask))
> -		return false;
> +	    (marks_mask & FS_ISDIR & ~marks_ignored_mask))
> +		return true;
>  
>  	if (event_mask & FAN_ALL_OUTGOING_EVENTS & marks_mask &
>  				 ~marks_ignored_mask)
> 

I dont think that this is an issue in kernel code. The test code tries
to get events for the current directory but never sets the FAN_ONDIR
flag for the concerning mark - so it hangs because it is waiting for
events that are never generated. Adding FAN_ONDIR to the set of mark
flags should fix the test code.

Regards,
Lino

      parent reply	other threads:[~2015-03-21  0:56 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-20 20:56 [PATCH 1/1 linux-next] fanotify: fix a lock in fanotify_should_send_event() Fabian Frederick
2015-03-20 21:09 ` Andrew Morton
2015-03-20 21:16   ` Fabian Frederick
2015-03-21  1:01   ` Lino Sanfilippo
2015-03-21  1:15     ` Lino Sanfilippo
2015-03-22  9:46       ` Fabian Frederick
2015-03-22 10:48         ` Lino Sanfilippo
2015-04-01  8:59           ` Jan Kara
2015-03-21  0:56 ` Lino Sanfilippo [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=550CC1BE.5050303@gmx.de \
    --to=linosanfilippo@gmx.de \
    --cc=akpm@linux-foundation.org \
    --cc=dhowells@redhat.com \
    --cc=eparis@redhat.com \
    --cc=fabf@skynet.be \
    --cc=jack@suse.cz \
    --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