diff options
author | Amir Goldstein <amir73il@gmail.com> | 2023-07-07 10:26:29 +0200 |
---|---|---|
committer | Amir Goldstein <amir73il@gmail.com> | 2023-08-12 18:02:50 +0200 |
commit | cbb44f0935974bba997f8db0458fac5739ae0009 (patch) | |
tree | c32f08f3a699457bbcf17a0e6b6e180d50732233 /fs/overlayfs/overlayfs.h | |
parent | ovl: store persistent uuid/fsid with uuid=on (diff) | |
download | linux-cbb44f0935974bba997f8db0458fac5739ae0009.tar.xz linux-cbb44f0935974bba997f8db0458fac5739ae0009.zip |
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.h | 4 |
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; } /* |