All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marko Rauhamaa <marko.rauhamaa@f-secure.com>
To: Jeff Layton <jlayton@poochiereds.net>
Cc: Amir Goldstein <amir73il@gmail.com>,
	Al Viro <viro@zeniv.linux.org.uk>,
	linux-fsdevel <linux-fsdevel@vger.kernel.org>,
	Jan Kara <jack@suse.cz>,
	Linux NFS Mailing List <linux-nfs@vger.kernel.org>
Subject: Re: fanotify read returns with errno == EOPENSTALE
Date: Thu, 23 Mar 2017 14:43:12 +0200	[thread overview]
Message-ID: <8760j02mfz.fsf@drapion.f-secure.com> (raw)
In-Reply-To: <1490270212.3921.10.camel@poochiereds.net> (Jeff Layton's message of "Thu, 23 Mar 2017 07:56:52 -0400")

Jeff Layton <jlayton@poochiereds.net>:

> It was definitely not the intention to leak this error code to
> userland. EOPENSTALE is not a POSIX sanctioned error code, so
> applications generally don't know anything about it and will be
> confused.

Got it. I will try to work on a reproduction and make a proper bug
report.

> I haven't looked closely at this particular problem, but IIRC we
> usually just translate EOPENSTALE to ESTALE, and that may be all that
> needs to be done here. If this happened in the RHEL kernel, then
> please do open a bug with Red Hat and we'll get it straightened out.

ESTALE has not been mentioned as a possible error code from an fanotify
read. Most importantly, since read fails, I suppose there is no recovery
but you must close the fanotify fd and call fanotify_init() again. Or
should I just ignore it and read on? If so, why bother returning the
error from the kernel in the first place?

> That said, you should take heed that all of the [fa|i|d]notify APIs do
> not extend beyond the local machine when you use them on network
> filesystems. If you're expecting to get notification of events that
> are occurring on other clients, you're going to be disappointed here.

That certainly is disappointing. However, there is a certain level of
coherency one would expect, namely:

 * An NFS4 client opening a file should be subject to an OPEN_PERM check
   on that client (if the client is monitoring the mount point).

 * An NFS4 client opening a file should be subject to an OPEN_PERM check
   on the server (if the server is monitoring the mount point).

 * An fanotify read should not fail mysteriously. Rather, a read on
   metadata->fd should be the one failing.


Marko

  reply	other threads:[~2017-03-23 13:16 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-22 15:31 fanotify read returns with errno == EOPENSTALE Marko Rauhamaa
2017-03-22 18:01 ` Matthew Wilcox
2017-03-22 18:20 ` Amir Goldstein
2017-03-22 19:17   ` Amir Goldstein
2017-03-22 19:31   ` Al Viro
2017-03-22 19:39     ` Amir Goldstein
2017-03-23  8:13       ` Marko Rauhamaa
2017-03-23 11:46         ` Amir Goldstein
2017-03-23 11:56           ` Jeff Layton
2017-03-23 12:43             ` Marko Rauhamaa [this message]
     [not found]               ` <8760j02mfz.fsf-q6puBR44SRrF1m+2HNTUelaTQe2KTcn/@public.gmane.org>
2017-03-23 13:47                 ` Amir Goldstein
2017-03-23 13:47                   ` Amir Goldstein
2017-03-23 13:47                   ` Amir Goldstein
     [not found]                   ` <CAOQ4uxja14p02jQurLTGv_fHrs+UBa5qfacrgY_-7tyv6UJqdw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-04-19 13:46                     ` Marko Rauhamaa
2017-04-19 13:46                       ` Marko Rauhamaa
     [not found]                       ` <87lgqwa4tg.fsf-q6puBR44SRrF1m+2HNTUelaTQe2KTcn/@public.gmane.org>
2017-04-20 11:06                         ` Amir Goldstein
2017-04-20 11:06                           ` Amir Goldstein
     [not found]                           ` <CAOQ4uxirSfVVYBexXrWccDHnE5oqxNgUh3-X5Ey1w4R=nHXDjA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-04-20 11:33                             ` Amir Goldstein
2017-04-20 11:33                               ` Amir Goldstein
     [not found]                               ` <CAOQ4uxjA8Z7wnwuHFCKeKT1xz0Gh-qS40Y6cfPi3fAM0MKsRuQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-04-20 12:43                                 ` Marko Rauhamaa
2017-04-20 12:43                                   ` Marko Rauhamaa
     [not found]                                   ` <87shl38d1x.fsf-q6puBR44SRrF1m+2HNTUelaTQe2KTcn/@public.gmane.org>
2017-04-20 13:34                                     ` Amir Goldstein
2017-04-20 13:34                                       ` Amir Goldstein
     [not found]                                       ` <CAOQ4uxiJyrvEJMhM1jhiE5pCgP0iA_LL4Eo_h7UY00wkTKhbTg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-04-21 13:13                                         ` Marko Rauhamaa
2017-04-21 13:13                                           ` Marko Rauhamaa
2017-04-20 14:20                               ` Jan Kara
     [not found]                                 ` <20170420142035.GE22135-4I4JzKEfoa/jFM9bn6wA6Q@public.gmane.org>
2017-04-20 15:06                                   ` Amir Goldstein
2017-04-20 15:06                                     ` Amir Goldstein
     [not found]                                     ` <CAOQ4uxgAOJjWP6PHY6WgOkNK0vmaTWnFZN+Jvea7zpjJ_VU8Bw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-04-22  7:22                                       ` Amir Goldstein
2017-04-22  7:22                                         ` Amir Goldstein
     [not found]                                         ` <CAOQ4uxgkXz+8=m2o_faAh2g2Z21KhAf67WckgPNWhktz1=DaWA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-04-24  7:40                                           ` Marko Rauhamaa
2017-04-24  7:40                                             ` Marko Rauhamaa

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=8760j02mfz.fsf@drapion.f-secure.com \
    --to=marko.rauhamaa@f-secure.com \
    --cc=amir73il@gmail.com \
    --cc=jack@suse.cz \
    --cc=jlayton@poochiereds.net \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /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.