Re: [PATCH] ovl: warn about orphan metacopy

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Aug 23, 2020 at 5:14 AM Kevin Locke <kevin@xxxxxxxxxxxxxxx> wrote:
>
> When the lower file of a metacopy is inaccessible, -EIO is returned.
> For users not familiar with overlayfs internals, such as myself, the
> meaning of this error may not be apparent or easy to determine, since
> the (metacopy) file is present and open/stat succeed when accessed
> outside of the overlay.
>
> Add a rate-limited warning for invalid metacopy to give users a hint
> when investigating such errors, as discussed on linux-unionfs[0].  Use
> "orphan metacopy" terminology to match "orphan index entry" in
> ovl_verify_index.
>
> [0]: https://lore.kernel.org/linux-unionfs/CAOQ4uxi23Zsmfb4rCed1n=On0NNA5KZD74jjjeyz+et32sk-gg@xxxxxxxxxxxxxx/
>
> Signed-off-by: Kevin Locke <kevin@xxxxxxxxxxxxxxx>
> ---
>  fs/overlayfs/namei.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/fs/overlayfs/namei.c b/fs/overlayfs/namei.c
> index f7d4358db637..30e1c10800ab 100644
> --- a/fs/overlayfs/namei.c
> +++ b/fs/overlayfs/namei.c
> @@ -1000,6 +1000,7 @@ struct dentry *ovl_lookup(struct inode *dir, struct dentry *dentry,
>          * Just make sure a corresponding data dentry has been found.
>          */
>         if (d.metacopy || (uppermetacopy && !ctr)) {
> +               pr_warn_ratelimited("orphan metacopy (%pd2)\n", dentry);

Funny. You started this thread because of a pain point - you did not know
what caused EIO in your setup.

Try to go back to where you stood when you got EIO.
Would that message in the log would have helped you understand?
Would it have helped someone who is less skilled than you are in reading
kernel code? I doubt it.

You better be more explicit about what has gone wrong, e.g.:
"metacopy upper with no lower data found - abort lookup..."

It is nice that you followed a precedent of "orphan index", but if you
look closely you will see that those cases do not end up with a user
error - they end up with auto cleaning those "orphan index", so the
kernel messages are just FYI - it doesn't matter if users understand them
because they do not require users to take any action.

Thanks,
Amir.



[Index of Archives]     [Linux Filesystems Devel]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux