.. | .. |
---|
31 | 31 | }; |
---|
32 | 32 | |
---|
33 | 33 | struct ovl_layer { |
---|
| 34 | + /* ovl_free_fs() relies on @mnt being the first member! */ |
---|
34 | 35 | struct vfsmount *mnt; |
---|
35 | 36 | /* Trap in ovl inode cache */ |
---|
36 | 37 | struct inode *trap; |
---|
.. | .. |
---|
41 | 42 | int fsid; |
---|
42 | 43 | }; |
---|
43 | 44 | |
---|
| 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 | + |
---|
44 | 53 | struct ovl_path { |
---|
45 | 54 | const struct ovl_layer *layer; |
---|
46 | 55 | struct dentry *dentry; |
---|