All of lore.kernel.org
 help / color / mirror / Atom feed
From: "J. R. Okajima" <hooanon05g@gmail.com>
To: Amir Goldstein <amir73il@gmail.com>
Cc: Miklos Szeredi <miklos@szeredi.hu>,
	"open list:OVERLAY FILESYSTEM" <linux-unionfs@vger.kernel.org>
Subject: Re: [WIP][RFC] questions about overlay index dir design
Date: Thu, 18 May 2017 16:11:29 +0900	[thread overview]
Message-ID: <5981.1495091489@jrobl> (raw)
In-Reply-To: <CAOQ4uxgTG5JhmAb2hQF0ZoyFAfdOCSPDcScNL=8y7xJ1sXiHJg@mail.gmail.com>

Amir Goldstein:
> WIP is at https://github.com/amir73il/linux/commits/ovl-index-dir.
> I could post patches, but I rather not spam you now unless asked.
>
> So far it does the job of creating the non-dir upper hardlinks in index
> dir and unbreaking hardlinks on copy up (ignoring concurrent copy up
> of 2 lower hardlinks for now).

The very basic design (as a first step) is close to aufs' "pseudo-link".

(from linux/Documentation/filesystems/aufs/design/0strcut.txt)
----------------------------------------
Pseudo-link
----------------------------------------------------------------------
Assume "fileA" exists on the lower readonly branch only and it is
hardlinked to "fileB" on the branch. When you write something to fileA,
aufs copies-up it to the upper writable branch. Additionally aufs
creates a hardlink under the Pseudo-link Directory of the writable
branch. The inode of a pseudo-link is kept in aufs super_block as a
simple list. If fileB is read after unlinking fileA, aufs returns
filedata from the pseudo-link instead of the lower readonly
branch. Because the pseudo-link is based upon the inode, to keep the
inode number by xino (see above) is essentially necessary.

All the hardlinks under the Pseudo-link Directory of the writable branch
should be restored in a proper location later. Aufs provides a utility
to do this. The userspace helpers executed at remounting and unmounting
aufs by default.
During this utility is running, it puts aufs into the pseudo-link
maintenance mode. In this mode, only the process which began the
maintenance mode (and its child processes) is allowed to operate in
aufs. Some other processes which are not related to the pseudo-link will
be allowed to run too, but the rest have to return an error or wait
until the maintenance mode ends. If a process already acquires an inode
mutex (in VFS), it has to return an error.
----------------------------------------

How do you think about the lifetime of the entries under ovl-index-dir?
Aufs has a user-space utility to restore/reproduce all hardlinks on the
upper writable layer, and it removes the entries under Pseudo-link
Directory.


J. R. Okajima

  reply	other threads:[~2017-05-18  7:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-17 23:08 [WIP][RFC] questions about overlay index dir design Amir Goldstein
2017-05-18  7:11 ` J. R. Okajima [this message]
2017-05-18  7:47   ` Amir Goldstein
2017-05-18 14:15 ` Amir Goldstein
2017-05-19 14:16   ` Miklos Szeredi
2017-05-23 10:04     ` Amir Goldstein

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=5981.1495091489@jrobl \
    --to=hooanon05g@gmail.com \
    --cc=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.