summaryrefslogtreecommitdiff
path: root/fs/overlayfs/overlayfs.h
diff options
context:
space:
mode:
authorAmir Goldstein <amir73il@gmail.com>2023-07-07 11:26:29 +0300
committerAmir Goldstein <amir73il@gmail.com>2023-08-12 19:02:50 +0300
commitcbb44f0935974bba997f8db0458fac5739ae0009 (patch)
treec32f08f3a699457bbcf17a0e6b6e180d50732233 /fs/overlayfs/overlayfs.h
parentd9544c1b0d9e14a66936814dcc8a85861ea1b99f (diff)
ovl: auto generate uuid for new overlay filesystems
Add a new mount option uuid=auto, which is the default. If a persistent UUID xattr is found it is used. Otherwise, an existing ovelrayfs with copied up subdirs in upper dir that was never mounted with uuid=on retains the null UUID. A new overlayfs with no copied up subdirs, generates the persistent UUID on first mount. Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Diffstat (limited to 'fs/overlayfs/overlayfs.h')
-rw-r--r--fs/overlayfs/overlayfs.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/overlayfs/overlayfs.h b/fs/overlayfs/overlayfs.h
index 8b026d758eaf..72f57d919aa9 100644
--- a/fs/overlayfs/overlayfs.h
+++ b/fs/overlayfs/overlayfs.h
@@ -71,6 +71,7 @@ enum {
enum {
OVL_UUID_OFF,
OVL_UUID_NULL,
+ OVL_UUID_AUTO,
OVL_UUID_ON,
};
@@ -550,7 +551,8 @@ static inline bool ovl_origin_uuid(struct ovl_fs *ofs)
static inline bool ovl_has_fsid(struct ovl_fs *ofs)
{
- return ofs->config.uuid == OVL_UUID_ON;
+ return ofs->config.uuid == OVL_UUID_ON ||
+ ofs->config.uuid == OVL_UUID_AUTO;
}
/*