From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Hellwig Subject: Re: [PATCH 22/26] sys_mknodat(): elevate write count for vfs_mknod/create() Date: Wed, 11 Jul 2007 11:22:32 +0100 Message-ID: <20070711102232.GB21947@infradead.org> References: <20070622200303.82D9CC3A@kernel> <20070622200332.DCCD1884@kernel> <20070623075103.GS27954@infradead.org> <1182784792.26162.86.camel@localhost> <20070630093901.GI22354@infradead.org> <1183675412.10287.91.camel@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Christoph Hellwig , haveblue@linux.vnet.ibm.com, akpm@osdl.org, linux-fsdevel@vger.kernel.org, viro@ftp.linux.org.uk To: Dave Hansen Return-path: Received: from pentafluge.infradead.org ([213.146.154.40]:41918 "EHLO pentafluge.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758341AbXGKKWg (ORCPT ); Wed, 11 Jul 2007 06:22:36 -0400 Content-Disposition: inline In-Reply-To: <1183675412.10287.91.camel@localhost> Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Thu, Jul 05, 2007 at 03:43:32PM -0700, Dave Hansen wrote: > This takes care of all of the direct callers of vfs_mknod(). > Since a few of these cases also handle normal file creation > as well, this also covers some calls to vfs_create(). > > So that we don't have to make three mnt_want/drop_write() > calls inside of the switch statement, we move some of its > logic outside of the switch. Looks good to me. > One thing I noticed: do we actually _need_ the first > S_ISDIR() check at the top of the function? The EPERM is required by Posix. > + if (!S_ISREG(mode) && !S_ISCHR(mode) && !S_ISBLK(mode) && > + !S_ISFIFO(mode) && !S_ISSOCK(mode) && (mode != 0)) { no need for braces around the mode != 0