[PATCH 4/4] fs: btrfs: initialize @ii in show_dir() to make coverity happy

Marek Behun marek.behun at nic.cz
Mon Nov 2 00:06:56 CET 2020


On Sat, 31 Oct 2020 09:07:52 +0800
Qu Wenruo <wqu at suse.com> wrote:

> In show_dir() if we hit file type FT_CHRDEV or FT_BLKDEV, we expect an
> BTRFS_INODE_ITEM_KEY, and for that case, we should have @ii filled with
> data read from disk.
> 
> We even have ASSERT() for this purpose, but unfortunately coverity can't
> understand the ASSERT() nor if we get key type BTRFS_INODE_ITEM_KEY,
> previous if() branch must go to the read_extent_buffer() branch to fill
> the @ii.
> 
> So to make coverity happy, just initialize the variable @ii to all zero.

WTF. If ASSERT excludes this from happening, coverity should understand
this. We live in 2020. I don't much like the idea to do things just to
get coverity happy if it can't understand and infer from things like
ASSERT.


More information about the U-Boot mailing list