public inbox for linux-unionfs@vger.kernel.org
 help / color / mirror / Atom feed
From: "YoungJun.Park" <her0gyugyu@gmail.com>
To: Amir Goldstein <amir73il@gmail.com>
Cc: linux-unionfs@vger.kernel.org
Subject: Re: Re: Question about ESTALE error whene deleting upper directory file.
Date: Sun, 6 Nov 2022 23:06:21 -0800	[thread overview]
Message-ID: <20221107070621.GA1860348@ubuntu> (raw)
In-Reply-To: <CAOQ4uxipsS3Xf00fvY4fEBgJX8MZK2VW8sHANLA6h8qoEeAiCA@mail.gmail.com>

On Mon, Nov 07, 2022 at 08:40:02AM +0200, Amir Goldstein wrote:
> On Mon, Nov 7, 2022 at 6:38 AM YoungJun.Park <her0gyugyu@gmail.com> wrote:
> >
> > Here is my curious scenario.
> >
> > 1. create a file on overlayfs.
> > 2. delete a file on upper directory.
> > 3. can see file contents using read sys call. (may file operations all success)
> > 4. cannot remove, rename. it return -ESTALE error (may inode operations fail)
> >
> > I understand this scenario onto the code level.
> > But I don't understand this situation itself.
> >
> > I found a overlay kernel docs and it comments
> > Changes to underlying filesystems section
> >
> > ...
> > Changes to the underlying filesystems while part of a mounted overlay filesystem are not allowed.
> > If the underlying filesystem is changed, the behavior of the overlay is undefined,
> > though it will not result in a crash or deadlock.
> > ....
> >
> > So here is my question (may it is suggestion)
> >
> > 1. underlying file system change is not allowed, then how about implementing shadow upper directory from user?
> > 2. if read, write system call is allowed, how about changing remove, rename(and more I does not percept) operation success?
> >
> 
> What is your use case?
> Why do you think this is worth spending time on?
> If anything, we could implement revalidate to return ESTALE also from open
> in such a case.
> But again, why do you think that would matter?
> 
> Thanks,
> Amir.

Thank you for replying.
I develop antivirus scanner.
When developing, I am confronted the situaion below.

1. make a docker container using overlayfs
2. our antivirus scanner detect on upperdir and remove it.
3. When I check container, the file contents can be read, buf file cannot be removed.(-ESTALE error)

And as I think, the reason is upperdir is touchable. So it is better to hide upperdir.
If it is hard to implement(or maybe there is a other reson that I don' know)
it is better to make the situation is clear 
(file operation error, inode operations error or file operation success , inode operation success)

Thank you again Amir.
Best regards

  reply	other threads:[~2022-11-07  7:06 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-07  4:29 Question about ESTALE error whene deleting upper directory file YoungJun.Park
2022-11-07  6:40 ` Amir Goldstein
2022-11-07  7:06   ` YoungJun.Park [this message]
2022-11-07  8:49     ` Amir Goldstein
2022-11-08  8:14       ` YoungJun.Park
     [not found]         ` <CAOQ4uxi2aGUOCrPb55Q9LGVbqz4M9ZKOhNLnm8kKnsDQgdxYHQ@mail.gmail.com>
2022-11-08 12:37           ` YoungJun.Park
2022-11-08 19:22             ` Amir Goldstein
2022-11-09  4:16               ` YoungJun.Park
2022-11-09  9:16                 ` Amir Goldstein
2022-11-09  9:34                   ` YoungJun.Park

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=20221107070621.GA1860348@ubuntu \
    --to=her0gyugyu@gmail.com \
    --cc=amir73il@gmail.com \
    --cc=linux-unionfs@vger.kernel.org \
    /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