Linux Overlay Filesystem development
 help / color / mirror / Atom feed
* [PATCH] ovl: warn about orphan metacopy
@ 2020-08-23  2:14 Kevin Locke
  2020-08-23 14:12 ` Amir Goldstein
  0 siblings, 1 reply; 5+ messages in thread
From: Kevin Locke @ 2020-08-23  2:14 UTC (permalink / raw)
  To: Miklos Szeredi; +Cc: linux-unionfs, Amir Goldstein

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@mail.gmail.com/

Signed-off-by: Kevin Locke <kevin@kevinlocke.name>
---
 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);
 		err = -EIO;
 		goto out_put;
 	} else if (!d.is_dir && upperdentry && !ctr && origin_path) {
-- 
2.28.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-10-30 12:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-08-23  2:14 [PATCH] ovl: warn about orphan metacopy Kevin Locke
2020-08-23 14:12 ` Amir Goldstein
2020-08-23 14:30   ` Kevin Locke
2020-08-23 14:38     ` [PATCH v2] " Kevin Locke
2020-10-30 12:30       ` Miklos Szeredi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox