Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755170AbYHXXwB (ORCPT ); Sun, 24 Aug 2008 19:52:01 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753342AbYHXXvv (ORCPT ); Sun, 24 Aug 2008 19:51:51 -0400 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 Date: Sun, 24 Aug 2008 16:51:46 -0700 (PDT) From: Linus Torvalds To: Al Viro cc: Jan Harkes , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [RFC] readdir mess In-Reply-To: <20080824195908.GQ28946@ZenIV.linux.org.uk> 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> User-Agent: Alpine 1.10 (LFD 962 2008-03-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1107 Lines: 37 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); -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/