Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752860AbYHLUiW (ORCPT ); Tue, 12 Aug 2008 16:38:22 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751946AbYHLUiM (ORCPT ); Tue, 12 Aug 2008 16:38:12 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:38904 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751582AbYHLUiL (ORCPT ); Tue, 12 Aug 2008 16:38:11 -0400 Date: Tue, 12 Aug 2008 21:38:08 +0100 From: Al Viro To: Linus Torvalds Cc: OGAWA Hirofumi , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [RFC] readdir mess Message-ID: <20080812203808.GV28946@ZenIV.linux.org.uk> References: <20080812062241.GQ28946@ZenIV.linux.org.uk> <87ej4u9nf5.fsf@devron.myhome.or.jp> <20080812181057.GR28946@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1274 Lines: 24 On Tue, Aug 12, 2008 at 01:21:56PM -0700, Linus Torvalds wrote: > We *must* handle partial returns by returning "success". And we do, > except for our _confusion_ about ->readdir() returning error and that > somehow "overriding" the fact that it already returned non-errors earlier > through the callback. > > All your blathering about "positive values as well" seems to ttoally > misunderstand how readdir() works. We absolutely do *not* need positive > return values, because the fact is, the only positive return value we ever > need is the "we already filled _earlier_ buffers". And that's the one > that we already do. > > The fact is, NO ERROR VALUE CAN POSSIBLY MATTER if we already returned one > or more entries to getdents/readdir(). We should return a success value. Would you care to grep for vfs_readdir() in the tree? It's not just sys_getdents(); for better of worse the thing had become a general-purpose iterator. And I'm not suggesting to pass the damn thing to caller of sys_getdents(). At all. -- 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/