From mboxrd@z Thu Jan 1 00:00:00 1970 From: "J. R. Okajima" Subject: Re: Question about overlayfs ovl_link Date: Wed, 29 Feb 2012 14:09:27 +0900 Message-ID: <25498.1330492167@jrobl> References: <878vjnbb9k.fsf@tucsk.pomaz.szeredi.hu> Cc: Miklos Szeredi , linux-fsdevel@vger.kernel.org To: Robin Dong Return-path: Received: from mail03-md.ns.itscom.net ([175.177.155.113]:59278 "EHLO mail03-md.ns.itscom.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750829Ab2B2FJb (ORCPT ); Wed, 29 Feb 2012 00:09:31 -0500 Received: from scan05-mds.s.noc.itscom.net (scan05-md.ns.itscom.net [175.177.155.100]) by mail03-md-outgoing.ns.itscom.net (Postfix) with ESMTP id 206CEFF0482 for ; Wed, 29 Feb 2012 14:09:28 +0900 (JST) In-Reply-To: Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Robin Dong: > There are two ways to fix this problem. > First, traverse all alias of inode to find a non-zero-d_count dentry, > this may be inefficient > Second, create a new overlayfs inode and a new overlayfs dentry in > ovl_link, that will make the result of two actions > ("create link" then "mount", or "mount" then "create link") consistent. How about third one (as for the original "two inodes" problem)? - create a table to convert the uppderdir (real) inode number into the overlayfs (virtual) inode number. - using the table, you can get the virtual inum from the real inum. - as long as you have a single real inum (for hardlinks), you will get a single virtual inum. J. R. Okajima