From: Marko Rauhamaa Subject: Re: fanotify read returns with errno == EOPENSTALE Date: Thu, 20 Apr 2017 15:43:22 +0300 Message-ID: <87shl38d1x.fsf@drapion.f-secure.com> References: <87inn12urq.fsf@drapion.f-secure.com> <20170322193122.GV29622@ZenIV.linux.org.uk> <87a88c2yxq.fsf@drapion.f-secure.com> <1490270212.3921.10.camel@poochiereds.net> <8760j02mfz.fsf@drapion.f-secure.com> <87lgqwa4tg.fsf@drapion.f-secure.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: In-Reply-To: (Amir Goldstein's message of "Thu, 20 Apr 2017 14:33:04 +0300") Sender: linux-api-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Amir Goldstein Cc: Jeff Layton , Al Viro , linux-fsdevel , Jan Kara , Linux NFS Mailing List , linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: linux-api@vger.kernel.org Amir Goldstein : > Sorry I messed up the previous patch. please try this one: I will try it. > + * do the right thing if there are no more events to > + * read (i.e. return bytes read, -EAGAIN or wait). EAGAIN is the right thing to do when FAN_NONBLOCK has been specified. Without FAN_NONBLOCK, EAGAIN is bound to confuse the application. That could be documented, of course. More importantly, does EAGAIN here still guarantee EPOLLET semantics of epoll(7)? IOW, if I get EAGAIN, I shouldn't have to try read(2)ing the fanotify fd again before calling epoll_wait(2). Marko