Skip to contentSkip to conversation

btrfs: print checksum type and implementation at mount time

PATCH In review David Sterba 3 participants 3 messages Jun 22, 2022 – Jun 23, 2022 Btrfs file system

lore
Share & tools
lore

David Sterba

author maintainer
#0 lore raw

PATCH 1/1 btrfs: print checksum type and implementation at mount time

Per user request, print the checksum type and implementation at mount time among the messages. The checksum is user configurable and the actual crypto implementation is useful to see for performance reasons. The same information is also available after mount in /sys/fs/FSID/checksum file.

Example:

  [25.323662] BTRFS info (device vdb): using sha256 (sha256-generic) checksum algorithm
---
 fs/btrfs/disk-io.c | 3 +++
 1 file changed, 3 insertions(+)
fs/btrfs/disk-io.c +3 -0
index 8592eaf6de53..debfc756d67e 100644
@@ -2410,6 +2410,9 @@ static int btrfs_init_csum_hash(struct btrfs_fs_info *fs_info, u16 csum_type)
 
 	fs_info->csum_shash = csum_shash;
 
+	btrfs_info(fs_info, "using %s (%s) checksum algorithm",
+			btrfs_super_csum_name(csum_type),
+			crypto_shash_driver_name(csum_shash));
 	return 0;
 }
 
Signature · 1 line
2.36.1
Reviewed-by on v1 1/1
#2 lore raw
In reply to David Sterba
Quoted 6 lines · David Sterba

Per user request, print the checksum type and implementation at mount time among the messages. The checksum is user configurable and the actual crypto implementation is useful to see for performance reasons. The same information is also available after mount in /sys/fs/FSID/checksum file.

Quoted 6 lines

Example:

   [25.323662] BTRFS info (device vdb): using sha256 (sha256-generic) checksum algorithm