History

fs: Clarify FS_CASEFOLD_FL semantics in UAPI header

The existing one-liner "Folder is case insensitive" leaves the impression that FS_CASEFOLD_FL is reserved for directories. That impression is wrong: filesystems that derive case-insensitivity from mount or volume state report the bit on non-directory inodes via i_op->fileattr_get, so userspace inspecting FS_IOC_GETFLAGS can see it on any inode type. Replace the one-liner with a block comment that names directories as the typical case, records that non-directory inodes may also report the bit, and notes FS_XFLAG_CASEFOLD as the read-only companion exposed through FS_IOC_FSGETXATTR.

Chuck Lever committed 5 months ago

Commit 45e57cf1 parent 42529421 file · +10 −1Browse files

Showing the changes to include/uapi/linux/fs.h (1 of 1 file). Show all

Unified · Split

include/uapi/linux/fs.h+10−1
@@ -395,7 +395,16 @@ struct file_attr { · 394 unmodified lines
395395 #define FS_DAX_FL 0x02000000 /* Inode is DAX */
396396 #define FS_INLINE_DATA_FL 0x10000000 /* Reserved for ext4 */
397397 #define FS_PROJINHERIT_FL 0x20000000 /* Create with parents projid */
398−#define FS_CASEFOLD_FL 0x40000000 /* Folder is case insensitive */
398+/*
399+ * FS_CASEFOLD_FL indicates case-insensitive name lookup. The
400+ * bit is most often reported on directories, where it controls
401+ * lookups of entries within. Filesystems that derive
402+ * case-insensitivity from mount or volume state may also report
403+ * it on non-directory inodes; userspace must not assume the bit
404+ * is directory-only. FS_XFLAG_CASEFOLD reports the same
405+ * information read-only via FS_IOC_FSGETXATTR.
406+ */
407+#define FS_CASEFOLD_FL 0x40000000
399408 #define FS_RESERVED_FL 0x80000000 /* reserved for ext2 lib */
400409
401410 #define FS_FL_USER_VISIBLE 0x0003DFFF /* User visible flags */