linux-unionfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ovl: relax lookup error on mismatch origin ftype
@ 2021-04-27 10:28 Amir Goldstein
       [not found] ` <123ca2cd.45f7.1792236c0e9.Coremail.ouyangxuan10@163.com>
  2021-07-21 13:10 ` Miklos Szeredi
  0 siblings, 2 replies; 8+ messages in thread
From: Amir Goldstein @ 2021-04-27 10:28 UTC (permalink / raw)
  To: Miklos Szeredi; +Cc: Byron, Kevin Locke, linux-unionfs

We get occasional reports of lookup errors due to mismatched
origin ftype from users that re-format a lower squashfs image.

Commit 13c6ad0f45fd ("ovl: document lower modification caveats")
tries to discourage the practice of re-formating lower layers and
describes the expected behavior as undefined.

Commit b0e0f69731cd ("ovl: restrict lower null uuid for "xino=auto"")
limits the configurations in which origin file handles are followed.

In addition to these measures, change the behavior in case of detecting
a mismatch origin ftype in lookup to issue a warning, not follow origin,
but not fail the lookup operation either.

That should make overall more users happy without any big consequences.

Link: https://lore.kernel.org/linux-unionfs/CAOQ4uxgPq9E9xxwU2CDyHy-_yCZZeymg+3n+-6AqkGGE1YtwvQ@mail.gmail.com/
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
---

Miklos,

I am getting tired of dealing with lower squashfs related reports.
How about this?

It passes the xfstests quick tests and no, I do not have a reproducer
for origin mismatch, so will wait for Byron to test the patch.

Thanks,
Amir.

 fs/overlayfs/namei.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/overlayfs/namei.c b/fs/overlayfs/namei.c
index 71e264e2f16b..850c0a37f1f0 100644
--- a/fs/overlayfs/namei.c
+++ b/fs/overlayfs/namei.c
@@ -392,7 +392,7 @@ int ovl_check_origin_fh(struct ovl_fs *ofs, struct ovl_fh *fh, bool connected,
 			    upperdentry, d_inode(upperdentry)->i_mode & S_IFMT,
 			    d_inode(origin)->i_mode & S_IFMT);
 	dput(origin);
-	return -EIO;
+	return -EINVAL;
 }
 
 static int ovl_check_origin(struct ovl_fs *ofs, struct dentry *upperdentry,
@@ -408,7 +408,7 @@ static int ovl_check_origin(struct ovl_fs *ofs, struct dentry *upperdentry,
 	kfree(fh);
 
 	if (err) {
-		if (err == -ESTALE)
+		if (err == -ESTALE || err == -EINVAL)
 			return 0;
 		return err;
 	}
-- 
2.25.1


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

end of thread, other threads:[~2021-07-21 14:46 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-27 10:28 [PATCH] ovl: relax lookup error on mismatch origin ftype Amir Goldstein
     [not found] ` <123ca2cd.45f7.1792236c0e9.Coremail.ouyangxuan10@163.com>
2021-04-30 16:16   ` Amir Goldstein
     [not found]     ` <74a06ca.4928.17941146e4b.Coremail.ouyangxuan10@163.com>
2021-05-06 10:25       ` Amir Goldstein
     [not found]         ` <39ca38d.1ec8.17944f144b3.Coremail.ouyangxuan10@163.com>
2021-05-07  6:09           ` Amir Goldstein
2021-07-21 13:10 ` Miklos Szeredi
2021-07-21 14:16   ` Amir Goldstein
2021-07-21 14:33     ` Miklos Szeredi
2021-07-21 14:46       ` Amir Goldstein

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).