From: Eric Wong Subject: Re: [PATCH v3 2/2] FUSE: Adapt readdirplus to application usage patterns Date: Sun, 3 Feb 2013 07:15:34 +0000 Message-ID: <20130203071534.GA12174@dcvr.yhbt.net> References: <87mx1ngmip.fsf@tucsk.pomaz.szeredi.hu> <1358220208-27131-1-git-send-email-steve.shuo.feng@gmail.com> <1358220208-27131-3-git-send-email-steve.shuo.feng@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: fuse-devel@lists.sourceforge.net, linux-fsdevel@vger.kernel.org, Miklos Szeredi To: Feng Shuo Return-path: Received: from dcvr.yhbt.net ([64.71.152.64]:33982 "EHLO dcvr.yhbt.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751593Ab3BCHPf (ORCPT ); Sun, 3 Feb 2013 02:15:35 -0500 Content-Disposition: inline In-Reply-To: <1358220208-27131-3-git-send-email-steve.shuo.feng@gmail.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Feng Shuo wrote: > Use the same adaptive readdirplus mechanism as NFS: > > http://permalink.gmane.org/gmane.linux.nfs/49299 > > If the user space implementation wants to disable readdirplus > temporarily, it could just return ENOTSUPP. Then kernel will > recall it with readdir. The version of this patch in "for-next" in git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse.git (commit 4582a4ab2a0e7218449fb2e895d0aae9ea753c94) seems to be causing problems for me with "find -ls" (I trivially backported all the for-next patches to 3.7.5) I see getdents() returning a single d_name="" entry at the end of the list, leading to infinite looping when combined with the userspace patches I posted in http://mid.gmane.org/20130202043316.GA19751@dcvr.yhbt.net Normally getdents() returns 0 to indicate EOF on the directory; but with this patch, I no longer get that... This only seems to happen on large directories which require multiple getdents() calls. Sometimes "ls -l" will succeed and "find -ls" will fail, and sometimes strace seems to make the problem go away... It could be a bug in my end in userspace, too. However, reverting the version of this patch that landed in for-next seems to avoid the issue for me. I've also verified none of my userspace code is sending dentries with an empty name.