From: Amir Goldstein <amir73il@gmail.com>
To: Miklos Szeredi <miklos@szeredi.hu>
Cc: overlayfs <linux-unionfs@vger.kernel.org>
Subject: Re: [PATCH 2/3] ovl: disable xino for some nested overlay cases
Date: Wed, 24 Oct 2018 18:03:51 +0300 [thread overview]
Message-ID: <CAOQ4uxh+iO87Urj8sUAPHXdBpLzT45gNPFKWGD6M6ALRc0ALAQ@mail.gmail.com> (raw)
In-Reply-To: <CAJfpegsp875XA96r_u_uteiN85WMQ7G4A5ogWPTt+aJG2XgVcQ@mail.gmail.com>
On Wed, Oct 24, 2018 at 5:30 PM Miklos Szeredi <miklos@szeredi.hu> wrote:
>
> On Mon, Sep 3, 2018 at 8:12 AM, Amir Goldstein <amir73il@gmail.com> wrote:
> > There are three possible cases when overlayfs is used as lower
> > layer for a nested overlay mount:
> >
> > 1. lower overlay is non-samefs with xino enabled
> > 2. lower overlay is non-samefs with xino disabled
> > 3. lower overlay is samefs
> >
> > In the first case, lower layer uses high inode number bits, so they are
> > not available for the nested overlay and xino should be disabled.
> >
> > In the second case, inode numbers of lower layer are not in a single
> > address space, so there is no use enabling xino in nested overlay.
> >
> > In the last case (samefs) the lower layer inode number address space
> > is that of the underlying real fs, so we can assign fsid of the lower
> > layer according the the real underlying fs.
> >
> > In the private case of all lower overlay layers on the same fs, which is
> > also the upper fs of the nested overlay, the nested overlay itself is
> > treated as "samefs", because inode numbers in all layers are from the
> > same address space.
> >
> > Signed-off-by: Amir Goldstein <amir73il@gmail.com>
> > ---
> > fs/overlayfs/overlayfs.h | 8 ++++++++
> > fs/overlayfs/super.c | 25 +++++++++++++++++++++++--
> > 2 files changed, 31 insertions(+), 2 deletions(-)
> >
> > diff --git a/fs/overlayfs/overlayfs.h b/fs/overlayfs/overlayfs.h
> > index f61839e1054c..d32fe09a222f 100644
> > --- a/fs/overlayfs/overlayfs.h
> > +++ b/fs/overlayfs/overlayfs.h
> > @@ -418,3 +418,11 @@ int ovl_set_origin(struct dentry *dentry, struct dentry *lower,
> >
> > /* export.c */
> > extern const struct export_operations ovl_export_operations;
> > +
> > +/* super.c */
> > +extern struct file_system_type ovl_fs_type;
> > +
> > +static inline bool ovl_is_overlay_fs(struct super_block *sb)
> > +{
> > + return sb->s_type == &ovl_fs_type;
> > +}
>
> Special casing like that is, well, ugly.
>
> Generic solution (which would work in the face of other stacking fs)
> would be to have a "ino-space-id" in the super block that would be
> assigned to a unique number for all distinct filesystems, but stacking
> fs would be able to reset it to the origin filesystem's id if
> appropriate.
>
> What do you think about that?
>
I either did not understand your suggestion or have not explained the
purpose of this patch properly.
We wanted to have s_maxinobits, but xfs refused to commit to its
current effective maxinobits. So we gave the power to the users
(who allegedly studied their undelying filesystem ino address space) to tell
overlayfs using the xino=on option that underlying filesystem does NOT use
the highest ino bits.
Generally, we have no way of knowing if the user research was wrong, expect
for one particular case - upderlying fs is overlayfs and underlying overlayfs
has xino enabled.
*This* is why I have the "special casing" here. I am not interested to know
if this is a stacked filesystem.
So maybe what we can do is declare s_maxinobits.
Have some filesystems commit to s_maxinobits = 32 instead of the encode_fh
trick. I filesystems leave s_maxinobits 0 then user is allowed to
force xino = on.
Overlayfs with xino = on will set s_maxinobits to max of all layers s_maxinobits
+ the bits needed to identify the layer.
If overlay doesn't know the underlying maxinobits, it will used the highest bits
for layer id and set s_maxinobits = 64.
Does that make sense?
Thanks,
Amir.
next prev parent reply other threads:[~2018-10-24 15:03 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-03 6:12 [PATCH 0/3] Enable new features for more overlayfs setups Amir Goldstein
2018-09-03 6:12 ` [PATCH 1/3] ovl: relax requirement for non null uuid of lower fs Amir Goldstein
2018-10-24 14:16 ` Miklos Szeredi
2018-10-24 15:29 ` Amir Goldstein
2018-09-03 6:12 ` [PATCH 2/3] ovl: disable xino for some nested overlay cases Amir Goldstein
2018-10-24 14:30 ` Miklos Szeredi
2018-10-24 15:03 ` Amir Goldstein [this message]
2018-10-24 15:19 ` Miklos Szeredi
2018-10-24 16:11 ` Amir Goldstein
2018-09-03 6:12 ` [PATCH 3/3] ovl: compact nested ovl_fh Amir Goldstein
2018-10-24 14:34 ` Miklos Szeredi
2018-10-24 17:56 ` 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=CAOQ4uxh+iO87Urj8sUAPHXdBpLzT45gNPFKWGD6M6ALRc0ALAQ@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).