Skip to contentSkip to conversation

create_inode: do not fail if filesystem doesn't support xattr

PATCH Applied Jürg Billeter 2 participants 2 messages Aug 18, 2022 – Sep 19, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 create_inode: do not fail if filesystem doesn't support xattr

As set_inode_xattr() doesn't fail if the llistxattr() function is not available, it seems inconsistent to let set_inode_xattr() fail if llistxattr() fails with ENOTSUP, indicating that the filesystem doesn't support extended attributes.

---
 misc/create_inode.c | 2 ++
 1 file changed, 2 insertions(+)
misc/create_inode.c +2 -0
index c00d5458..d7ab1c20 100644
@@ -150,6 +150,8 @@ static errcode_t set_inode_xattr(ext2_filsys fs, ext2_ino_t ino,
 
 	size = llistxattr(filename, NULL, 0);
 	if (size == -1) {
+		if (errno == ENOTSUP)
+			return 0;
 		retval = errno;
 		com_err(__func__, retval, _("while listing attributes of \"%s\""),
 			filename);
Signature · 1 line
2.35.3
#1 lore raw
Quoted 6 lines · Jürg Billeter

As set_inode_xattr() doesn't fail if the llistxattr() function is not available, it seems inconsistent to let set_inode_xattr() fail if llistxattr() fails with ENOTSUP, indicating that the filesystem doesn't support extended attributes.

Applied, thanks!

[1/1] create_inode: do not fail if filesystem doesn't support xattr

      commit: 985b46c55070c62153587e5b18ecb5310706546c

Best regards,

Signature · 1 line
Theodore Ts'o <[email protected]>