From mboxrd@z Thu Jan 1 00:00:00 1970 From: Linus Torvalds Subject: Re: [RFC] readdir mess Date: Sun, 24 Aug 2008 16:51:46 -0700 (PDT) Message-ID: References: <20080812181057.GR28946@ZenIV.linux.org.uk> <20080812203808.GV28946@ZenIV.linux.org.uk> <20080813000433.GZ28946@ZenIV.linux.org.uk> <20080815050613.GJ4422@cs.cmu.edu> <20080824101014.GN28946@ZenIV.linux.org.uk> <20080824195908.GQ28946@ZenIV.linux.org.uk> Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Cc: Jan Harkes , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org To: Al Viro Return-path: Received: from smtp1.linux-foundation.org ([140.211.169.13]:46557 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753339AbYHXXvv (ORCPT ); Sun, 24 Aug 2008 19:51:51 -0400 In-Reply-To: <20080824195908.GQ28946@ZenIV.linux.org.uk> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Sun, 24 Aug 2008, Al Viro wrote: > > The fact that coda_readdir() will _not_ be returning 0 with your change > when called with the arguments old_readdir() gives it? You'll get ret > from filldir, i.e. what you'll normally see will be -EINVAL in case of > fillonedir as callback. Ahh. A light finally goes on. No on the first filldir() callback, but on the second. Yeah, so this should fix it. Linus --- fs/readdir.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/fs/readdir.c b/fs/readdir.c index 4e026e5..4899ba4 100644 --- a/fs/readdir.c +++ b/fs/readdir.c @@ -115,7 +115,7 @@ asmlinkage long old_readdir(unsigned int fd, struct old_linux_dirent __user * di buf.dirent = dirent; error = vfs_readdir(file, fillonedir, &buf); - if (error >= 0) + if (buf.result || error >= 0) error = buf.result; fput(file);