linux-unionfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Amir Goldstein <amir73il@gmail.com>
To: Vyacheslav Yurkov <uvv.mail@gmail.com>
Cc: Miklos Szeredi <miklos@szeredi.hu>,
	overlayfs <linux-unionfs@vger.kernel.org>,
	Vyacheslav Yurkov <Vyacheslav.Yurkov@bruker.com>
Subject: Re: [PATCH v2 2/3] ovl: add ovl_allow_offline_changes() helper
Date: Thu, 27 May 2021 20:32:13 +0300	[thread overview]
Message-ID: <CAOQ4uxgiyZUJZHEJ_rK3tt2eLC-FHD6XBFLcNnAiGbVHbONmSQ@mail.gmail.com> (raw)
In-Reply-To: <20210527140534.107607-2-uvv.mail@gmail.com>

On Thu, May 27, 2021 at 5:06 PM Vyacheslav Yurkov <uvv.mail@gmail.com> wrote:
>
> From: Vyacheslav Yurkov <Vyacheslav.Yurkov@bruker.com>
>
> Allows to check whether any of extended features are enabled
>
> Signed-off-by: Vyacheslav Yurkov <Vyacheslav.Yurkov@bruker.com>
> ---
>  fs/overlayfs/overlayfs.h | 12 ++++++++++++
>  fs/overlayfs/super.c     |  4 +---
>  2 files changed, 13 insertions(+), 3 deletions(-)
>
> diff --git a/fs/overlayfs/overlayfs.h b/fs/overlayfs/overlayfs.h
> index 6ec73db4bf9e..29d71f253db4 100644
> --- a/fs/overlayfs/overlayfs.h
> +++ b/fs/overlayfs/overlayfs.h
> @@ -262,6 +262,18 @@ static inline bool ovl_open_flags_need_copy_up(int flags)
>         return ((OPEN_FMODE(flags) & FMODE_WRITE) || (flags & O_TRUNC));
>  }
>
> +static inline bool ovl_allow_offline_changes(struct ovl_fs *ofs)
> +{
> +       /*
> +        * To avoid regressions in existing setups with overlay lower offline
> +        * changes, we allow lower changes only if none of the new features
> +        * are used.
> +        */
> +       return (!ofs->config.index && !ofs->config.metacopy &&
> +               !ofs->config.redirect_dir && ofs->config.xino != OVL_XINO_ON);
> +}
> +
> +
>  /* util.c */
>  int ovl_want_write(struct dentry *dentry);
>  void ovl_drop_write(struct dentry *dentry);
> diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c
> index 97ea35fdd933..a248cbad9a8c 100644
> --- a/fs/overlayfs/super.c
> +++ b/fs/overlayfs/super.c
> @@ -1599,9 +1599,7 @@ static bool ovl_lower_uuid_ok(struct ovl_fs *ofs, const uuid_t *uuid)
>          * user opted-in to one of the new features that require following the
>          * lower inode of non-dir upper.
>          */
> -       if (!ofs->config.index && !ofs->config.metacopy &&
> -           !ofs->config.redirect_dir && ofs->config.xino != OVL_XINO_ON &&
> -           uuid_is_null(uuid))
> +       if (!ovl_allow_offline_changes(ofs) && uuid_is_null(uuid))

You accidently negated the condition.
IOW, allow_lower_changes and null_uuid are conflicting features.

Thanks,
Amir.

>                 return false;
>
>         for (i = 0; i < ofs->numfs; i++) {
> --
> 2.25.1
>

  reply	other threads:[~2021-05-27 17:32 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-27 14:05 [PATCH v2 1/3] ovl: disable uuid when redirect_dir is used Vyacheslav Yurkov
2021-05-27 14:05 ` [PATCH v2 2/3] ovl: add ovl_allow_offline_changes() helper Vyacheslav Yurkov
2021-05-27 17:32   ` Amir Goldstein [this message]
2021-05-27 14:05 ` [PATCH v2 3/3] ovl: do not set overlay.opaque for new directories Vyacheslav Yurkov
2021-05-27 17:34   ` Amir Goldstein
2021-05-27 17:39 ` [PATCH v2 1/3] ovl: disable uuid when redirect_dir is used 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=CAOQ4uxgiyZUJZHEJ_rK3tt2eLC-FHD6XBFLcNnAiGbVHbONmSQ@mail.gmail.com \
    --to=amir73il@gmail.com \
    --cc=Vyacheslav.Yurkov@bruker.com \
    --cc=linux-unionfs@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    --cc=uvv.mail@gmail.com \
    /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).