Skip to contentSkip to conversation

overlayfs: Warn instead of error if d_type is not supported

PATCH New Vivek Goyal 1 participant 1 message Jul 1, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 overlayfs: Warn instead of error if d_type is not supported

overlay needs underlying fs to support d_type. Recently I put in a patch in to detect this condition and started failing mount if underlying fs did not support d_type.

45aebea ovl: Ensure upper filesystem supports d_type

But this breaks existing configurations over kernel upgrade. Those who are running docker (partially broken configuration) with xfs not supporting d_type, are surprised that after kernel upgrade docker does not run anymore.

https://github.com/docker/docker/issues/22937#issuecomment-229881315

So instead of erroring out, detect broken configuration and warn about it. This should allow existing docker setups to continue working after kernel upgrade.

---
 fs/overlayfs/super.c |   12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
fs/overlayfs/super.c +7 -5
Index: rhvgoyal-linux/fs/overlayfs/super.c
===================================================================
@@ -1082,11 +1082,13 @@ static int ovl_fill_super(struct super_b
 			if (err < 0)
 				goto out_put_workdir;
 
-			if (!err) {
-				pr_err("overlayfs: upper fs needs to support d_type.\n");
-				err = -EINVAL;
-				goto out_put_workdir;
-			}
+			/*
+			 * We allowed this configuration and don't want to
+			 * break users over kernel upgrade. So warn instead
+			 * of erroring out.
+			 */
+			if (!err)
+				pr_warn("overlayfs: upper fs needs to support d_type.\n");
 		}
 	}