From mboxrd@z Thu Jan 1 00:00:00 1970 From: Valerie Aurora Subject: union mounts via ->get_unlinked_inode() Date: Tue, 17 Aug 2010 14:12:07 -0400 Message-ID: <20100817181207.GA5556@shell> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-fsdevel@vger.kernel.org, Alexander Viro , Nick Piggin , Jan Kara , Andreas Gruenbacher To: Miklos Szeredi Return-path: Received: from mx1.redhat.com ([209.132.183.28]:30241 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753492Ab0HQSMa (ORCPT ); Tue, 17 Aug 2010 14:12:30 -0400 Content-Disposition: inline Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Hey Miklos, At the FS workshop, I came up with an idea that will fix the crash-during-copyup bug and also allow atomic creation of whiteouts/fallthrus/opaque flags using xattrs, as you proposed. Instead of ->whiteout() and ->fallthru(), we add just one new file system op, ->get_unlinked_inode(), which returns an inode that is allocated but not linked into the namespace - basically, ->create() followed by ->unlink() without a window in which the partly initialized file will be visible if the system crashes. This is usually already implemented internally by the file system, just not exported, so it should be minimally invasive. Then we can copy up data, set owner, set the whiteout xattr, etc. and when the inode is consistent, link it into the namespace. Currently, whiteouts and fallthrus are implemented with an in-dentry flag so there is no crash-atomicity problem, but there will be with the xattr-based version. So, if the ->get_unlinked_inode() based version works out, I would be very interested in seeing your whiteout/opaque/fallthru via xattrs implementation and merging it into my tree. Thanks, -VAL