Closed chrisd8088 closed 5 years ago
@kivikakk, I just realized I left XATTR_CREATE
in there, and I meant to think more about that. Please don't merge quite yet; I may want to add a toggle so that the empty top-level dir can already have our xattr and we won't throw an error. Stay tuned.
OK, now that's what I meant to do. Sorry about that!
If we use the single character
y
instead of a binary 1 as the flag value of ouruser.projection.empty
extended attribute, then the command-linegetfattr(1)
utility guesses the attribute value has a text encoding and prints a human-readable"y"
instead of a Base64-encoded string.This also aligns us with how overlayfs flags its opaque directories (i.e., with
"trusted.overlay.opaque"="y"
).We can also collect our various calls to
fsetxattr(2)
into a new common function, which then simplifies some of our error handling.And, we can use
XATTR_CREATE
on allfsetxattr()
calls, except for the top-level directory which we expect to exist at mount time and might have a leftover attribute from a previous projfs mount.