Skip to contentSkip to conversation

ocfs2-restore-erange-check-in-ocfs2_xattr_tree_list_index_block.patch removed from -mm tree

merged mm-nonmm-stable Andrew Morton 1 participant 1 message Oct 11

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: ocfs2: restore -ERANGE check in ocfs2_xattr_tree_list_index_block()
has been removed from the -mm tree. Its filename was
ocfs2-restore-erange-check-in-ocfs2_xattr_tree_list_index_block.patch

This patch was dropped because it was merged into the mm-nonmm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: Joseph Qi <[email protected]>
Subject: ocfs2: restore -ERANGE check in ocfs2_xattr_tree_list_index_block()
Date: Tue, 22 Sep 2026 17:42:52 +0800

ocfs2_xattr_list_entry() returns -ERANGE when the buffer handed in by the caller is too small to hold the whole xattr name list. That is the normal listxattr(2) protocol, userspace simply retries with a larger buffer, so it is not an ocfs2 error and must not be logged as one.

Commit a46fa684fcb700 ("ocfs2: Don't printk the error when listing too many xattrs.") already knew this and silenced two sites, quoting

(27738,0):ocfs2_iterate_xattr_buckets:3158 ERROR: status = -34 (27738,0):ocfs2_xattr_tree_list_index_block:3264 ERROR: status = -34

The refactoring in commit 47bca4950bc40f ("ocfs2: Abstract ocfs2 xattr tree extend rec iteration process.") then rewrote ocfs2_xattr_tree_list_index_block() around the new ocfs2_iterate_xattr_index_block() helper and dropped that guard, so the second message has been emitted ever since:

ocfs2_xattr_tree_list_index_block:4513 ERROR: status = -34

The exemption in ocfs2_iterate_xattr_buckets() survived because that function was left alone, and the new helper does check for -ERANGE itself, which is why only the outermost caller still logs it.

Restore the missing check. Only the log line changes: -ERANGE is still returned to the VFS untouched, so listxattr(2) behaves exactly as before.

---

 fs/ocfs2/xattr.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
fs/ocfs2/xattr.c renamed from fs/ocfs2/xattr.c~ocfs2-restore-erange-check-in-ocfs2_xattr_tree_list_index_block +2 -1
@@ -4526,7 +4526,8 @@ static int ocfs2_xattr_tree_list_index_b
 	ret = ocfs2_iterate_xattr_index_block(inode, blk_bh,
 					      ocfs2_list_xattr_tree_rec, &xl);
 	if (ret) {
-		mlog_errno(ret);
+		if (ret != -ERANGE)
+			mlog_errno(ret);
 		goto out;
 	}
 

_

Patches currently in -mm which might be from [email protected] are

ocfs2-deal-with-legacy-signed-dir-index-name-hash-values.patch ocfs2-deal-with-legacy-signed-xattr-name-hash-values.patch ocfs2-reserve-metadata-for-a-new-xattr-block-and-its-value-tree.patch ocfs2-reserve-value-tree-metadata-when-moving-an-xattr-into-the-inode.patch ocfs2-reserve-xattr-value-tree-metadata-only-once.patch