From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756222AbcK2VvZ (ORCPT ); Tue, 29 Nov 2016 16:51:25 -0500 Received: from mail-oi0-f67.google.com ([209.85.218.67]:34655 "EHLO mail-oi0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752169AbcK2Vup (ORCPT ); Tue, 29 Nov 2016 16:50:45 -0500 MIME-Version: 1.0 X-Originating-IP: [217.173.44.24] In-Reply-To: References: <20161125212934.GB2622@veci.piliscsaba.szeredi.hu> From: Miklos Szeredi Date: Tue, 29 Nov 2016 22:49:51 +0100 Message-ID: Subject: Re: [POC/RFC PATCH] overlayfs: constant inode numbers To: Amir Goldstein Cc: "linux-unionfs@vger.kernel.org" , linux-fsdevel , linux-kernel Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 29, 2016 at 1:03 PM, Amir Goldstein wrote: > On Tue, Nov 29, 2016 at 1:34 PM, Amir Goldstein wrote: >> On Tue, Nov 29, 2016 at 12:16 PM, Miklos Szeredi wrote: >>> On Mon, Nov 28, 2016 at 12:56 PM, Amir Goldstein wrote: >> Not sure that I understand what you are suggesting, but I would be happy >> to make the needed adjustments to redirect_fh per your request if you clarify >> what you mean. From what I understand: >> >> 1. If redirect_dir=fh (and supported by layers), store lower handle >> on dir copy up in new xattr OVL_XATTR_FH >> 2. In ovl_rename(), set OVL_XATTR_REDIRECT regardless of OVL_XATTR_FH >> 3. In ovl_lookup_single(), carry both d.redirct and d.redirect_fh to next layer >> 4. In ovl_lookup_layer(), lookup by handle first then by path >> >> Mind you that unlike OVL_XATTR_INO, OVL_XATTR_FH points to *next* inode >> rather then *lowest* inode, so it does not really improve anything wrt >> getting the >> stable inode. Stable inode of merged dir is available after lookup in >> oe->lowerstack[oe->numlower - 1].dentry->d_inode->i_ino >> regardless of whether lookup was by handle or by path or no redirect at all, so >> not sure what you meant by "... and provide a good way to get the stable ino." >> Either I managed to confuse you, or I am missing something? I meant that we can unify OVL_XATTR_INO with "redirect/fh" functionality and get something good out of it. > Perhaps you meant for non-dir: > > 5. If redirect_dir=fh, *propagate* lowest-handle on non-dir copy up > 6. In ovl_lookup() of non-dir, decode lowest-handle to set oe->ino Yes. OVL_XATTR_FH would be safe to ignore, so this is back and forward compatible.. And the cost is probably not prohitive, since copy ups should be relatively rare. After a backup + restore it is not expected that we get back the old inode numbers so it's fine to ignore the stale file handles. The following issues are left: - performance of readdir; - what to do if not all layers are on the same fs; - hard link copy ups. Thanks, Miklos