Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: Johannes Thumshirn <Johannes.Thumshirn@wdc.com>
Cc: "dsterba@suse.cz" <dsterba@suse.cz>,
	"linux-btrfs@vger.kernel.org" <linux-btrfs@vger.kernel.org>,
	"stable@vger.kernel.org" <stable@vger.kernel.org>
Subject: Re: [PATCH v2 1/4] btrfs: pass checksum type via BTRFS_IOC_FS_INFO ioctl
Date: Mon, 13 Jul 2020 16:50:05 +0200	[thread overview]
Message-ID: <20200713145005.GK3703@twin.jikos.cz> (raw)
In-Reply-To: <SN4PR0401MB3598A0145F197C70A681EB5F9B600@SN4PR0401MB3598.namprd04.prod.outlook.com>

On Mon, Jul 13, 2020 at 02:28:36PM +0000, Johannes Thumshirn wrote:
> On 13/07/2020 16:27, David Sterba wrote:
> > On Mon, Jul 13, 2020 at 09:28:58PM +0900, Johannes Thumshirn wrote:
> >> --- a/fs/btrfs/ioctl.c
> >> +++ b/fs/btrfs/ioctl.c
> >> @@ -3217,11 +3217,15 @@ static long btrfs_ioctl_fs_info(struct btrfs_fs_info *fs_info,
> >>  	struct btrfs_ioctl_fs_info_args *fi_args;
> >>  	struct btrfs_device *device;
> >>  	struct btrfs_fs_devices *fs_devices = fs_info->fs_devices;
> >> +	u32 flags_in;
> > 
> > u64 here too, I'll fix it.
> 
> Uh, surprised why GCC didn't warn me about the truncation

The right warning for that is -Wconversion but it's off by default.
Integer type truncations are common becasue we know what we're doing
(except for the bugs).

fs/btrfs/ioctl.c: In function ‘btrfs_ioctl_fs_info’:
fs/btrfs/ioctl.c:3228:13: warning: conversion from ‘__u64’ {aka ‘long long unsigned int’} to ‘u32’ {aka ‘unsigned int’} may change value [-Wconversion]
 3228 |  flags_in = fi_args->flags;

Otherwise:

$ make ccflags-y=-Wconversion fs/btrfs/ioctl.o 2>&1 | grep warning: | wc -l
533

Most of them are from included headers.

  reply	other threads:[~2020-07-13 14:50 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-13 12:28 [PATCH v2 0/4] Two furhter additions for fsinfo ioctl Johannes Thumshirn
2020-07-13 12:28 ` [PATCH v2 1/4] btrfs: pass checksum type via BTRFS_IOC_FS_INFO ioctl Johannes Thumshirn
2020-07-13 14:27   ` David Sterba
2020-07-13 14:28     ` Johannes Thumshirn
2020-07-13 14:50       ` David Sterba [this message]
2020-07-13 12:28 ` [PATCH v2 2/4] btrfs: add filesystem generation to fsinfo ioctl Johannes Thumshirn
2020-07-15  7:21   ` Nikolay Borisov
2020-07-13 12:29 ` [PATCH v2 3/4] btrfs: add metadata_uuid " Johannes Thumshirn
2020-07-15  7:22   ` Nikolay Borisov
2020-07-13 12:29 ` [PATCH v2 4/4] btrfs: assert sizes of ioctl structures Johannes Thumshirn
2020-07-13 14:58   ` David Sterba
2020-07-13 16:13     ` Johannes Thumshirn
2020-07-13 21:01   ` kernel test robot
2020-07-14 11:20     ` David Sterba
2020-07-14 11:23       ` David Sterba

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200713145005.GK3703@twin.jikos.cz \
    --to=dsterba@suse.cz \
    --cc=Johannes.Thumshirn@wdc.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox