ovl: store persistent uuid/fsid with uuid=on

With uuid=on, store a persistent uuid in xattr on the upper dir to
give the overlayfs instance a persistent identifier.

This also makes f_fsid persistent and more reliable for reporting
fid info in fanotify events.

uuid=on is not supported on non-upper overlayfs or with upper fs
that does not support xattrs.

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
This commit is contained in:
Amir Goldstein
2023-07-07 11:20:41 +03:00
parent b0504bfe1b
commit d9544c1b0d
5 changed files with 57 additions and 3 deletions

View File

@@ -671,6 +671,9 @@ controlled by the "uuid" mount option, which supports these values:
UUID of underlying layers is ignored.
- "on":
UUID of overlayfs is generated and used to report a unique fsid.
UUID is stored in xattr "trusted.overlay.uuid", making overlayfs fsid
unique and persistent. This option requires an overlayfs with upper
filesystem that supports xattrs.
Volatile mount