lkml.org 
[lkml]   [2021]   [Jul]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH AUTOSEL 5.10 60/70] btrfs: sysfs: fix format string for some discard stats
    Date
    From: David Sterba <dsterba@suse.com>

    [ Upstream commit 8c5ec995616f1202ab92e195fd75d6f60d86f85c ]

    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>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    ---
    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 279d9262b676..3bb6b688ece5 100644
    --- a/fs/btrfs/sysfs.c
    +++ b/fs/btrfs/sysfs.c
    @@ -382,7 +382,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);
    @@ -404,7 +404,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);
    --
    2.30.2
    \
     
     \ /
      Last update: 2021-07-05 01:40    [W:9.701 / U:0.080 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site