From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Hellwig Subject: Re: [PATCH 06/26] elevate write count open()'d files Date: Sat, 23 Jun 2007 08:40:58 +0100 Message-ID: <20070623074058.GF27954@infradead.org> References: <20070622200303.82D9CC3A@kernel> <20070622200310.CD377780@kernel> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: akpm@osdl.org, linux-fsdevel@vger.kernel.org, hch@infradead.org, viro@ftp.linux.org.uk To: Dave Hansen Return-path: Received: from pentafluge.infradead.org ([213.146.154.40]:34670 "EHLO pentafluge.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751882AbXFWHlA (ORCPT ); Sat, 23 Jun 2007 03:41:00 -0400 Content-Disposition: inline In-Reply-To: <20070622200310.CD377780@kernel> Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Fri, Jun 22, 2007 at 01:03:10PM -0700, Dave Hansen wrote: > > This is the first really tricky patch in the series. It > elevates the writer count on a mount each time a > non-special file is opened for write. > > This is not completely apparent in the patch because the > two if() conditions in may_open() above the > mnt_want_write() call are, combined, equivalent to > special_file(). > > There is also an elevated count around the vfs_create() > call in open_namei(). The count needs to be kept elevated > all the way into the may_open() call. Otherwise, when the > write is dropped, a ro->rw transisition could occur. This > would lead to having rw access on the newly created file, > while the vfsmount is ro. That is bad. Looks good. > > Some filesystems forego the use of normal vfs calls to create > struct files. Make sure that these users elevate the mnt writer > count because they will get __fput(), and we need to make > sure they're balanced. With this you mean ipc/mqueue.c? You should probably mention that single bastard child of a wannabe-filesystem explicitly :)