From 973700943721d50952ab0712725e50ce09c34429 Mon Sep 17 00:00:00 2001 From: Auke Kok Date: Wed, 8 Apr 2026 11:37:06 -0700 Subject: [PATCH] Fix indx delete using wrong xid, leaving orphans. During inode deletion, scoutfs_xattr_drop forgot to set the xid of the xattr after calling parse_indx_key, which hardcodes xid=0, and it is the callers' responsibility. delete_force then deletes the wrong key, and returns no errors on nonexistant keys. So now there is a pending deletion for a non-existant indx and an orphan indx entry in the tree. Subsequent calls to `scoutfs read-xattr-index` will thus return entries for deleted inodes. Signed-off-by: Auke Kok --- kmod/src/xattr.c | 1 + 1 file changed, 1 insertion(+) diff --git a/kmod/src/xattr.c b/kmod/src/xattr.c index 7805b364..d8c468e3 100644 --- a/kmod/src/xattr.c +++ b/kmod/src/xattr.c @@ -1265,6 +1265,7 @@ int scoutfs_xattr_drop(struct super_block *sb, u64 ino, ret = parse_indx_key(&tag_key, xat->name, xat->name_len, ino); if (ret < 0) goto out; + scoutfs_xattr_set_indx_key_xid(&tag_key, le64_to_cpu(key.skx_id)); } if ((tgs.totl || tgs.indx) && locked_zone != tag_key.sk_zone) {