Return-Path: Received: from helmsgagent01.f-secure.com ([193.110.108.21]:45187 "EHLO helmsgagent01.f-secure.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S942878AbdDTMn2 (ORCPT ); Thu, 20 Apr 2017 08:43:28 -0400 From: Marko Rauhamaa To: Amir Goldstein CC: Jeff Layton , Al Viro , linux-fsdevel , Jan Kara , Linux NFS Mailing List , Subject: Re: fanotify read returns with errno == EOPENSTALE 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> Date: Thu, 20 Apr 2017 15:43:22 +0300 In-Reply-To: (Amir Goldstein's message of "Thu, 20 Apr 2017 14:33:04 +0300") Message-ID: <87shl38d1x.fsf@drapion.f-secure.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-nfs-owner@vger.kernel.org List-ID: 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