linux-unionfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Amir Goldstein <amir73il@gmail.com>
To: Sargun Dhillon <sargun@sargun.me>
Cc: overlayfs <linux-unionfs@vger.kernel.org>,
	Miklos Szeredi <miklos@szeredi.hu>,
	Alexander Viro <viro@zeniv.linux.org.uk>,
	Giuseppe Scrivano <gscrivan@redhat.com>,
	Vivek Goyal <vgoyal@redhat.com>,
	Daniel J Walsh <dwalsh@redhat.com>,
	linux-fsdevel <linux-fsdevel@vger.kernel.org>,
	David Howells <dhowells@redhat.com>
Subject: Re: [PATCH v1 3/3] overlay: Add rudimentary checking of writeback errseq on volatile remount
Date: Wed, 25 Nov 2020 16:03:06 +0200	[thread overview]
Message-ID: <CAOQ4uxhr1iLkvt+LK868pK=AaZ5O6vniPf2t8=u1=Pb+0ELPAw@mail.gmail.com> (raw)
In-Reply-To: <20201125104621.18838-4-sargun@sargun.me>

On Wed, Nov 25, 2020 at 12:46 PM Sargun Dhillon <sargun@sargun.me> wrote:
>
> Volatile remounts validate the following at the moment:
>  * Has the module been reloaded / the system rebooted
>  * Has the workdir been remounted
>
> This adds a new check for errors detected via the superblock's
> errseq_t. At mount time, the errseq_t is snapshotted to disk,
> and upon remount it's re-verified. This allows for kernel-level
> detection of errors without forcing userspace to perform a
> sync and allows for the hidden detection of writeback errors.
>

Looks fine as long as you verify that the reuse is also volatile.

Care to also add the alleged issues that Vivek pointed out with existing
volatile mount to the documentation? (unless Vivek intends to do fix those)

> Signed-off-by: Sargun Dhillon <sargun@sargun.me>
> ---
>  fs/overlayfs/overlayfs.h | 1 +
>  fs/overlayfs/readdir.c   | 6 ++++++
>  fs/overlayfs/super.c     | 1 +
>  3 files changed, 8 insertions(+)
>
> diff --git a/fs/overlayfs/overlayfs.h b/fs/overlayfs/overlayfs.h
> index de694ee99d7c..e8a711953b64 100644
> --- a/fs/overlayfs/overlayfs.h
> +++ b/fs/overlayfs/overlayfs.h
> @@ -85,6 +85,7 @@ struct ovl_volatile_info {
>          */
>         uuid_t          ovl_boot_id;    /* Must stay first member */
>         u64             s_instance_id;
> +       errseq_t        errseq; /* Implemented as a u32 */
>  } __packed;
>
>  /*
> diff --git a/fs/overlayfs/readdir.c b/fs/overlayfs/readdir.c
> index 4e3e2bc3ea43..2bb0641ecbbd 100644
> --- a/fs/overlayfs/readdir.c
> +++ b/fs/overlayfs/readdir.c
> @@ -1109,6 +1109,12 @@ static int ovl_verify_volatile_info(struct ovl_fs *ofs,
>                 return -EINVAL;
>         }
>
> +       err = errseq_check(&volatiledir->d_sb->s_wb_err, info.errseq);
> +       if (err) {
> +               pr_debug("Workdir filesystem reports errors: %d\n", err);
> +               return -EINVAL;
> +       }
> +
>         return 1;
>  }
>
> diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c
> index 9a1b07907662..49dee41ec125 100644
> --- a/fs/overlayfs/super.c
> +++ b/fs/overlayfs/super.c
> @@ -1248,6 +1248,7 @@ static int ovl_set_volatile_info(struct ovl_fs *ofs, struct dentry *volatiledir)
>         int err;
>         struct ovl_volatile_info info = {
>                 .s_instance_id = volatiledir->d_sb->s_instance_id,
> +               .errseq = errseq_sample(&volatiledir->d_sb->s_wb_err),
>         };
>
>         uuid_copy(&info.ovl_boot_id, &ovl_boot_id);
> --
> 2.25.1
>

  reply	other threads:[~2020-11-25 14:03 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-25 10:46 [PATCH v1 0/3] Make overlayfs volatile mounts reusable Sargun Dhillon
2020-11-25 10:46 ` [PATCH v1 1/3] fs: Add s_instance_id field to superblock for unique identification Sargun Dhillon
2020-11-25 10:46 ` [PATCH v1 2/3] overlay: Add the ability to remount volatile directories when safe Sargun Dhillon
2020-11-25 12:49   ` kernel test robot
2020-11-25 13:23   ` kernel test robot
2020-11-25 13:29   ` kernel test robot
2020-11-25 13:58   ` Amir Goldstein
2020-11-25 14:43   ` Vivek Goyal
2020-11-25 15:29     ` Sargun Dhillon
2020-11-25 18:17   ` Vivek Goyal
2020-11-25 18:31     ` Sargun Dhillon
2020-11-25 18:43       ` Vivek Goyal
2020-11-25 18:47         ` Sargun Dhillon
2020-11-25 18:52           ` Vivek Goyal
2020-11-25 19:37             ` Amir Goldstein
2020-11-25 10:46 ` [PATCH v1 3/3] overlay: Add rudimentary checking of writeback errseq on volatile remount Sargun Dhillon
2020-11-25 14:03   ` Amir Goldstein [this message]
2020-11-25 15:36     ` Vivek Goyal
2020-11-25 15:52       ` 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='CAOQ4uxhr1iLkvt+LK868pK=AaZ5O6vniPf2t8=u1=Pb+0ELPAw@mail.gmail.com' \
    --to=amir73il@gmail.com \
    --cc=dhowells@redhat.com \
    --cc=dwalsh@redhat.com \
    --cc=gscrivan@redhat.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-unionfs@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    --cc=sargun@sargun.me \
    --cc=vgoyal@redhat.com \
    --cc=viro@zeniv.linux.org.uk \
    /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).