Re: [PATCH v2 1/4] btrfs: pass checksum type via BTRFS_IOC_FS_INFO ioctl

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.



[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux