Skip to contentSkip to conversation

Semantics of setting an extended attribute to empty vs removexattr?

DISCUSSION Daniel Phillips 2 participants 3 messages Sep 24, 2008 – Sep 25, 2008 VFS

lore
Share & tools
lore
#0 lore raw

Hi,

Does anybody have an opinion on whether setting an extended attribute to empty using the setxattr interface is supposed to be semantically equivalent to removing the xattr using removexattr?

I rather wish this were the case in the interest of a robust usage model, but I pessimistically expect to learn that, no, an empty xattr is indeed different from an nonexistent xattr, similer to environment variables.

Regards,

Daniel

#1 lore raw
Quoted 5 lines · Daniel Phillips

Hi,

Does anybody have an opinion on whether setting an extended attribute to empty using the setxattr interface is supposed to be semantically equivalent to removing the xattr using removexattr?

attr(5) states...

NAME
attr - Extended attributes

DESCRIPTION
Extended attributes are name:value pairs associated permanently with files and directories, similar to the environment strings associated
with a process. An attribute may be defined or undefined. If it is
defined, its value may be empty or non-empty.

XFS and extN certainly implement this property, I'd imagine all of the other filesystems supporting extended attributes do as well.

cheers.

--
Nathan

#2 lore raw
Quoted 19 lines · Nathan Scott
Quoted 5 lines · Daniel Phillips

Hi,

Does anybody have an opinion on whether setting an extended attribute to empty using the setxattr interface is supposed to be semantically equivalent to removing the xattr using removexattr?

attr(5) states...

NAME
attr - Extended attributes

DESCRIPTION
Extended attributes are name:value pairs associated permanently with files and directories, similar to the environment strings associated
with a process. An attribute may be defined or undefined. If it is
defined, its value may be empty or non-empty.

Quoted 2 lines

XFS and extN certainly implement this property, I'd imagine all of the other filesystems supporting extended attributes do as well.

Yes, and Tux3 will be revised to toe the line, it's no big deal. Thanks for reading me the man page :-/

Regards,

Daniel