Re: [PATCH] btrfs: use proper type for failrec in extent_state

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

 





David Sterba wrote on 2016/02/22 18:58 +0100:
On Thu, Feb 11, 2016 at 01:24:13PM +0100, David Sterba wrote:
We use the private member of extent_state to store the failrec and play
pointless pointer games.

Signed-off-by: David Sterba <dsterba@xxxxxxxx>

I'm not sure why, but my gcc 5.3.1 think's that a member of failrec can
be used uninitialized:

   CC [M]  fs/btrfs/extent_io.o
fs/btrfs/extent_io.c: In function ‘clean_io_failure’:
fs/btrfs/extent_io.c:2133:4: warning: ‘failrec’ may be used uninitialized in this function [-Wmaybe-uninitialized]
     repair_io_failure(inode, start, failrec->len,
     ^

After applying your patch on integration-4.6, and compiling, my gcc 5.3.0 didn't give such warning though.

And I didn't see an official 5.3.1, but only 5.3 so I assume maybe it's related to the .1 from your distribution?
(As my gcc is from Archlinux, I assume minimally patched)

Thanks,
Qu

which points to:

2126         if (state && state->start <= failrec->start &&
2127             state->end >= failrec->start + failrec->len - 1) {
2128                 num_copies = btrfs_num_copies(fs_info, failrec->logical,
2129                                               failrec->len);
2130                 if (num_copies > 1)  {
2131                         repair_io_failure(inode, start, failrec->len,
2132                                           failrec->logical, page,
2133                                           pg_offset, failrec->failed_mirror);
2134                 }
2135         }

After separating all members to local varaibles, it points to ->len. Which is
used several times in code above.
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux