From 8e9f532ce419ae72ba47b49582342377780a32db Mon Sep 17 00:00:00 2001 From: Amir Goldstein Date: Mon, 6 Jul 2020 17:21:21 +0300 Subject: [PATCH] ovl: fix regression with re-formatted lower squashfs Relax the requirement for non null uuid only if user opts-in to index=on or nfs_export=on to avoid regressions with overlay that is migrated to a newly formatted lower squashfs. Reported-by: Fabian Fixes: 9df085f3c9a2 ("ovl: relax requirement for non null uuid...") Signed-off-by: Amir Goldstein --- fs/overlayfs/super.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c index 15939ab39c1c..af95f83e3a70 100644 --- a/fs/overlayfs/super.c +++ b/fs/overlayfs/super.c @@ -1402,6 +1402,16 @@ static bool ovl_lower_uuid_ok(struct ovl_fs *ofs, const uuid_t *uuid) if (!ofs->config.nfs_export && !ovl_upper_mnt(ofs)) return true; + /* + * We allow using single lower with null uuid for index and nfs_export + * for example to support those features with single lower squashfs. + * To avoid regressions setups of overlay with re-formatted lower + * squashfs do not allow decoding origin with lower null uuid unless + * index or nfs_export are explicitly enabled. + */ + if (!ofs->config.index && uuid_is_null(uuid)) + return false; + for (i = 0; i < ofs->numfs; i++) { /* * We use uuid to associate an overlay lower file handle with a -- 2.17.1