Thread (30 messages) 30 messages, 4 authors, 2021-05-26

Re: [PATCH 1/9] btrfs: sysfs: fix format string for some discard stats

From: Anand Jain <hidden>
Date: 2021-05-26 06:02:09

On 26/05/2021 01:08, David Sterba wrote:
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.

Signed-off-by: David Sterba <dsterba@suse.com>
Reviewed-by: Anand Jain <redacted>

quoted hunk ↗ jump to hunk
---
  fs/btrfs/sysfs.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/btrfs/sysfs.c b/fs/btrfs/sysfs.c
index c45d9b6dfdb5..4b508938e728 100644
--- a/fs/btrfs/sysfs.c
+++ b/fs/btrfs/sysfs.c
@@ -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);
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help