]> git.baikalelectronics.ru Git - kernel.git/commitdiff
btrfs: sysfs: fix format string for some discard stats
authorDavid Sterba <dsterba@suse.com>
Fri, 7 May 2021 18:00:14 +0000 (20:00 +0200)
committerDavid Sterba <dsterba@suse.com>
Mon, 21 Jun 2021 13:19:06 +0000 (15:19 +0200)
The type of discard_bitmap_bytes and discard_extent_bytes is u64 so the
format should be %llu, though the actual values would hardly ever
overflow to negative values.

Reviewed-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/sysfs.c

index c45d9b6dfdb53183eea8d7eb8498880d317f4a58..4b508938e728528a8db8c8526997dab3933128ee 100644 (file)
@@ -429,7 +429,7 @@ static ssize_t btrfs_discard_bitmap_bytes_show(struct kobject *kobj,
 {
        struct btrfs_fs_info *fs_info = discard_to_fs_info(kobj);
 
-       return scnprintf(buf, PAGE_SIZE, "%lld\n",
+       return scnprintf(buf, PAGE_SIZE, "%llu\n",
                        fs_info->discard_ctl.discard_bitmap_bytes);
 }
 BTRFS_ATTR(discard, discard_bitmap_bytes, btrfs_discard_bitmap_bytes_show);
@@ -451,7 +451,7 @@ static ssize_t btrfs_discard_extent_bytes_show(struct kobject *kobj,
 {
        struct btrfs_fs_info *fs_info = discard_to_fs_info(kobj);
 
-       return scnprintf(buf, PAGE_SIZE, "%lld\n",
+       return scnprintf(buf, PAGE_SIZE, "%llu\n",
                        fs_info->discard_ctl.discard_extent_bytes);
 }
 BTRFS_ATTR(discard, discard_extent_bytes, btrfs_discard_extent_bytes_show);