All of lore.kernel.org
 help / color / mirror / Atom feed
From: Amir Goldstein <amir73il@gmail.com>
To: Miklos Szeredi <miklos@szeredi.hu>
Cc: "linux-unionfs@vger.kernel.org" <linux-unionfs@vger.kernel.org>
Subject: Re: [PATCH 0/6] ovl: consistent_fd feature
Date: Fri, 7 Apr 2017 13:47:50 +0300	[thread overview]
Message-ID: <CAOQ4uxjbfBOvHMwe0xRdXox8Uy3XwdaxJmQpiYDVBT8854z4+w@mail.gmail.com> (raw)
In-Reply-To: <CAJfpegupcgWcP3yC=8Lpe-=m=oq_7f2OR9f14+p+ug+67gWBPA@mail.gmail.com>

On Fri, Apr 7, 2017 at 12:56 PM, Miklos Szeredi <miklos@szeredi.hu> wrote:
> On Fri, Apr 7, 2017 at 11:32 AM, Miklos Szeredi <miklos@szeredi.hu> wrote:
>> On Thu, Apr 6, 2017 at 6:25 PM, Amir Goldstein <amir73il@gmail.com> wrote:
>
>> When renaming a lower/merged directory or lower non-directory, always
>> add back-redirect pointer to moved object pointing to original
>> location, as well as forward-redirect to whiteout at original location
>> pointing to new location.   Possibly could do both with file handle.
>> Whenever either is moved/created/removed pointers need to be updated.
>> Hard linking a copied up file would result in duplication of the
>> forward pointers.  Solves the nfs export case, since we can always
>> find new location of objects based on location on lower layer.
>
> This breaks when an ancestor of a forward-redirect is moved/removed.

Right. but may still be feasible to mix this idea with a linked list
of only renamed dirs (topology transformation info).

>
> A linked list would still work, but all these are bit fragile.  I feel
> it's better to keep this sort of info out-of-band.
>

My main concern with out-of-band metadata is that we will have to sync
this metadata and it is easier to think on metadata transactions in
terms of changes
that are natively bundled together with the original inode
modification by the fs.

For that matter, I like the forward/backward redirect by fh idea, because
affected inodes are most of the time already part of the metadata transaction.
Also, backward redirect should be by path (like it is now) so it is
agnostic for more
renames and forward redirect should be by fh for the same reason and so it
is agnostic to moved object remove as well.

This is interesting enough for me to play with as part of "promotion"
for redirect_fh,
so I may just try to sketch some rough POC for NFS export.

Come to think about it, NFS export of regular file don't need to
follow renames at all:
- The handle for a regular file is always the handle for the real
lower or upper inode
- To decode a handle, create an O_TMPFILE style overlay dentry, which
is not linked
  to any path in overlay, but has the _upperdentry/lowerstack setup
- This way, nfsd can open a read-only handle from the ancient past (why not...)
- Directory handles would have to use the lowermost inode
- To decode a directory handle we need either forward redirect pointers on any
  new object created on top of lower dir or maintain a linked list  and hash or
  all renamed dirs

Am I missing something?

Amir.

  reply	other threads:[~2017-04-07 10:47 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-29 14:36 [PATCH 0/6] ovl: consistent_fd feature Amir Goldstein
2017-03-29 14:36 ` [PATCH 1/6] ovl: store path type in dentry Amir Goldstein
2017-03-29 14:36 ` [PATCH 2/6] ovl: cram opaque boolean into type flags Amir Goldstein
2017-03-29 14:36 ` [PATCH 3/6] ovl: check if all layers are on the same fs Amir Goldstein
2017-03-29 14:36 ` [PATCH 4/6] ovl: check if clone from lower to upper is supported Amir Goldstein
2017-03-29 14:36 ` [PATCH 5/6] ovl: copy on read with consistent_fd feature Amir Goldstein
2017-03-30 11:28   ` Amir Goldstein
2017-03-31 17:58   ` Vivek Goyal
2017-04-01  9:27     ` Amir Goldstein
2017-04-05 13:20       ` Amir Goldstein
2017-03-29 14:36 ` [PATCH 6/6] ovl: link upper tempfile on open for write Amir Goldstein
2017-03-30 11:26 ` [PATCH 7/7] ovl: prevent copy on read if no upper/work dir Amir Goldstein
2017-03-30 11:34 ` [PATCH 0/6] ovl: consistent_fd feature Amir Goldstein
2017-04-06 15:20   ` Miklos Szeredi
2017-04-06 15:37     ` Miklos Szeredi
2017-04-06 16:25       ` Amir Goldstein
2017-04-07  9:32         ` Miklos Szeredi
2017-04-07  9:56           ` Miklos Szeredi
2017-04-07 10:47             ` Amir Goldstein [this message]
2017-04-07 13:03               ` Miklos Szeredi
2017-04-07 15:07                 ` Amir Goldstein
2017-04-06 16:46     ` Amir Goldstein
2017-04-07  9:43       ` Miklos Szeredi
2017-04-07 11:04         ` Amir Goldstein
2017-04-08  3:03     ` J. R. Okajima

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAOQ4uxjbfBOvHMwe0xRdXox8Uy3XwdaxJmQpiYDVBT8854z4+w@mail.gmail.com \
    --to=amir73il@gmail.com \
    --cc=linux-unionfs@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.