hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/fs/overlayfs/ovl_entry.h
....@@ -31,6 +31,7 @@
3131 };
3232
3333 struct ovl_layer {
34
+ /* ovl_free_fs() relies on @mnt being the first member! */
3435 struct vfsmount *mnt;
3536 /* Trap in ovl inode cache */
3637 struct inode *trap;
....@@ -41,6 +42,14 @@
4142 int fsid;
4243 };
4344
45
+/*
46
+ * ovl_free_fs() relies on @mnt being the first member when unmounting
47
+ * the private mounts created for each layer. Let's check both the
48
+ * offset and type.
49
+ */
50
+static_assert(offsetof(struct ovl_layer, mnt) == 0);
51
+static_assert(__same_type(typeof_member(struct ovl_layer, mnt), struct vfsmount *));
52
+
4453 struct ovl_path {
4554 const struct ovl_layer *layer;
4655 struct dentry *dentry;