From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Hellwig Subject: Re: RFC: case-insensitive rename support in the VFS Date: Fri, 2 May 2008 02:22:52 -0400 Message-ID: <20080502062252.GA4705@infradead.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: "linux-fsdevel@vger.kernel.org" , viro@ftp.linux.org.uk To: Barry Naujok Return-path: Received: from bombadil.infradead.org ([18.85.46.34]:35348 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757367AbYEBGWx (ORCPT ); Fri, 2 May 2008 02:22:53 -0400 Content-Disposition: inline In-Reply-To: Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Fri, May 02, 2008 at 02:14:56PM +1000, Barry Naujok wrote: > As some of you know, I've been working on CI support for XFS. > Currently, the Linux VFS does not make this very easy and neat. > > One issue I've encountered is the case of rename in a CI > filesystem where the destination is the same as the source > (both parent and child) differing only in case. > > So, currently, do_rename() calls do_path_lookup() which > gets the source and destination dentries, etc. The third > parameter, flags, is stored in the nameidata structure > which is passed to the filesystem implementations of > lookup. > > vfs_rename() checks to see if the two dentry inodes are > the same, and if so, just returns 0. > > I propose adding a 7th LOOKUP_xxx flag for the rename case > where we indicate we are after an exact (non-CI) match for > the destination name in the lookup call in do_rename. > > Filesystem support in lookup would check for this flag > in addition to LOOKUP_CONTINUE not existing (ie. at the > last component during lookup) and if so, do an exact > lookup rather than a CI lookup as it normally would do. > Traditional non-CI filesystems would ignore this flag. I think passing a flag to the filesystem for this is fine, but flag in nameidata won't do it since lookup is going to lose the nameidata argument soon.