ntfs: support FS_IOC_GETFSUUID

NTFS reads the 64-bit volume serial number from the boot sector but leaves
the superblock UUID unset. As a result, the generic FS_IOC_GETFSUUID
handler returns ENOTTY for files and directories on an NTFS volume.

Register the on-disk little-endian serial number as an eight-byte
filesystem identifier with super_set_uuid(). The generic VFS handler can
then expose the existing volume identifier.

Signed-off-by: Baolin Liu <liubaolin@kylinos.cn>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
This commit is contained in:
Baolin Liu 2026-10-14 07:43:10 +08:00 committed by Namjae Jeon
parent 1a57e55f8c
commit feccce4df0

View File

@ -997,6 +997,8 @@ static bool parse_ntfs_boot_sector(struct ntfs_volume *vol,
vol->mft_record_size_bits;
ntfs_debug("vol->mftmirr_size = %i", vol->mftmirr_size);
vol->serial_no = le64_to_cpu(b->volume_serial_number);
super_set_uuid(vol->sb, (const u8 *)&b->volume_serial_number,
sizeof(b->volume_serial_number));
ntfs_debug("vol->serial_no = 0x%llx", vol->serial_no);
vol->sparse_compression_unit = 4;