From: Kevin Locke Date: Sun, 23 Aug 2020 14:38:17 +0000 (-0600) Subject: ovl: warn about orphan metacopy X-Git-Tag: accepted/tizen/unified/20230118.172025~8235^2~13 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0a8d0b64dd6acfbc9e9b79022654bbe1ade4a29a;p=platform%2Fkernel%2Flinux-rpi.git ovl: warn about orphan metacopy 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 orphan metacopy to give users a hint when investigating such errors. Link: https://lore.kernel.org/linux-unionfs/CAOQ4uxi23Zsmfb4rCed1n=On0NNA5KZD74jjjeyz+et32sk-gg@mail.gmail.com/ Signed-off-by: Kevin Locke Signed-off-by: Miklos Szeredi --- diff --git a/fs/overlayfs/namei.c b/fs/overlayfs/namei.c index f731eb4..509dac7 100644 --- a/fs/overlayfs/namei.c +++ b/fs/overlayfs/namei.c @@ -1006,6 +1006,8 @@ 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("metacopy with no lower data found - abort lookup (%pd2)\n", + dentry); err = -EIO; goto out_put; } else if (!d.is_dir && upperdentry && !ctr && origin_path) {