Re: [PATCH] ocfs2: validate xattr entry count in ocfs2_xattr_list_entries
From: Deepanshu Kartikey
Date: Mon Nov 17 2025 - 01:40:18 EST
Hi Heming,
Thank you for reviewing the patch! I've sent v2, but I used -EFSCORRUPTED
instead of -EFAULT/-ENOMEM. Here's my reasoning:
This code is detecting on-disk filesystem corruption (invalid xh_count
value from disk), not a memory error or allocation failure. Using
-EFSCORRUPTED:
1. Matches the existing error handling in ocfs2_xattr_find_entry() for
similar xattr corruption detection
2. Provides clearer semantics (corruption vs generic fault)
3. Is specifically designed for filesystem corruption cases
I'm happy to change it to -EFAULT if you still prefer, but wanted to
explain my reasoning. What do you think?
Thanks
Deepanshu