All of lore.kernel.org
 help / color / mirror / Atom feed
From: Amir Goldstein <amir73il@gmail.com>
To: yangerkun <yangerkun@huawei.com>
Cc: "zhangyi (F)" <yi.zhang@huawei.com>,
	overlayfs <linux-unionfs@vger.kernel.org>,
	Miklos Szeredi <miklos@szeredi.hu>, Miao Xie <miaoxie@huawei.com>
Subject: Re: [fsck.overlay RFC PATCH] overlay: add fsck utility
Date: Thu, 8 Mar 2018 09:37:31 +0200	[thread overview]
Message-ID: <CAOQ4uxh1ZXYyTiRXHGH1K9DyZrn8LLSdsqLvh+ueUwha_uYvxQ@mail.gmail.com> (raw)
In-Reply-To: <3581e04c-f4c7-226a-f88b-ec0ea394aa8d@huawei.com>

On Thu, Mar 8, 2018 at 4:32 AM, yangerkun <yangerkun@huawei.com> wrote:
[...]
>>>
>>> In fsck.overlay, lower layer file/dir may be modified with there is not
>>> I_OVL_INUSE in lower layer, but we cannot check does lower layer mounted
>>> with I_OVL_INUSE.
>>>
>>
>> Can you list the possible modifications the fsck.overlay can do on lower
>> layer?
>> What exactly are we trying to protect from?
>
>
> A orphan whiteout and invalid redirect in lower layer will be removed
> automatic or ask user.
> Since we cannot change anything for lower layer when overlay has been
> mounted, so we need run fsck.overlay first before mount to ensure
> consistency.

FWIW, I don't think that removing orphan whiteouts and invalid redirects
from lower layer can cause any damage when overlayfs is mounted
(famous last words), but I agree that in principle we should avoid fsck
on layers while overlayfs is mounted.

How about this - by default, lower layers are considered read-only and
fsck -a won't modify them, only report errors. fsck -y can be used to force
fixing lower layers. Maybe another flag could be used to indicate that
lower layers could be modified.

>>
>>
>>> Maybe we need adopt another way? How about store pwd in ofs.config when
>>> we
>>> mount the overlay.
>>>
>>
>> I don't understand what that means.
>
>
> We can use the parameters passed in by fsck.overlay and current working
> directory to construct absolute path for lower layers and upper layer; but
> when we want to get the information about mounted overlayfs through
> mountinfo, we cannot construct the absolute path of lower layer and upper
> layer without the pwd when we mount an overlayfs.

I see. I think that dealing with paths is wrong. pwd is not enough,
you also need
to know the mount ns root path. It's just not good to use path as an identifier.

Thanks,
Amir.

      reply	other threads:[~2018-03-08  7:37 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-17  5:49 [fsck.overlay RFC PATCH] overlay: add fsck utility zhangyi (F)
2017-11-17 17:13 ` Amir Goldstein
2017-11-17 18:39   ` Darrick J. Wong
2017-11-20  7:12     ` zhangyi (F)
2017-11-20  6:56   ` zhangyi (F)
2017-11-20  7:29     ` Amir Goldstein
2017-11-20  9:00       ` zhangyi (F)
2017-11-20  7:42     ` Eryu Guan
2017-11-21  2:30       ` Theodore Ts'o
2017-11-21  6:06         ` zhangyi (F)
2018-03-07  9:25   ` yangerkun
2018-03-07 11:14     ` Amir Goldstein
2018-03-07 11:20       ` Amir Goldstein
2018-03-08  2:38         ` yangerkun
2018-03-08  7:51           ` Amir Goldstein
2018-03-20 16:44             ` Miklos Szeredi
2018-03-20 16:55               ` Jeff Layton
2018-03-08  2:32       ` yangerkun
2018-03-08  7:37         ` Amir Goldstein [this message]

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=CAOQ4uxh1ZXYyTiRXHGH1K9DyZrn8LLSdsqLvh+ueUwha_uYvxQ@mail.gmail.com \
    --to=amir73il@gmail.com \
    --cc=linux-unionfs@vger.kernel.org \
    --cc=miaoxie@huawei.com \
    --cc=miklos@szeredi.hu \
    --cc=yangerkun@huawei.com \
    --cc=yi.zhang@huawei.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 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.