blk-merge warning in for-5.2/block
Jens Axboe
maintainerHi Ming,
I'm getting this one when building the new set with gcc 8.3.0:
-- In file included from block/blk-merge.c:13:block/blk-merge.c: In function ‘blk_rq_map_sg’:block/blk.h:73:56: warning: ‘bvec.bv_offset’ may be used uninitialized in this function [-Wmaybe-uninitialized]
phys_addr_t addr1 = page_to_phys(vec1->bv_page) + vec1->bv_offset;
~~~~^~~~~~~~~~~
block/blk-merge.c:530:17: note: ‘bvec.bv_offset’ was declared here
struct bio_vec bvec, bvprv = { NULL };
^~~~
In file included from block/blk-merge.c:13:
block/blk.h:76:18: warning: ‘bvec.bv_len’ may be used uninitialized in this function [-Wmaybe-uninitialized]
if (addr1 + vec1->bv_len != addr2)
~~~~^~~~~~~~
block/blk-merge.c:530:17: note: ‘bvec.bv_len’ was declared here
struct bio_vec bvec, bvprv = { NULL };
^~~~
In file included from ./arch/x86/include/asm/page.h:76,
from ./arch/x86/include/asm/thread_info.h:12,
from ./include/linux/thread_info.h:38,
from ./arch/x86/include/asm/preempt.h:7,
from ./include/linux/preempt.h:78,
from ./include/linux/spinlock.h:51,
from ./include/linux/seqlock.h:36,
from ./include/linux/time.h:6,
from ./include/linux/stat.h:19,
from ./include/linux/module.h:10,
from block/blk-merge.c:6:
./include/asm-generic/memory_model.h:55:52: warning: ‘bvec.bv_page’ may be used uninitialized in this function [-Wmaybe-uninitialized]
#define __page_to_pfn(page) (unsigned long)((page) - vmemmap)
^
block/blk-merge.c:530:17: note: ‘bvec.bv_page’ was declared here
struct bio_vec bvec, bvprv = { NULL };
^~~~Jens Axboe
Quoted 29 lines · Jens Axboe
Hi Ming,
I'm getting this one when building the new set with gcc 8.3.0:
-- In file included from
block/blk-merge.c:13:block/blk-merge.c: In function ‘blk_rq_map_sg’:block/blk.h:73:56: warning: ‘bvec.bv_offset’ may be used uninitialized in this function [-Wmaybe-uninitialized]phys_addr_t addr1 = page_to_phys(vec1->bv_page) + vec1->bv_offset; ~~~~^~~~~~~~~~~ block/blk-merge.c:530:17: note: ‘bvec.bv_offset’ was declared here struct bio_vec bvec, bvprv = { NULL }; ^~~~ In file included from block/blk-merge.c:13: block/blk.h:76:18: warning: ‘bvec.bv_len’ may be used uninitialized in this function [-Wmaybe-uninitialized] if (addr1 + vec1->bv_len != addr2) ~~~~^~~~~~~~ block/blk-merge.c:530:17: note: ‘bvec.bv_len’ was declared here struct bio_vec bvec, bvprv = { NULL }; ^~~~ In file included from ./arch/x86/include/asm/page.h:76, from ./arch/x86/include/asm/thread_info.h:12, from ./include/linux/thread_info.h:38, from ./arch/x86/include/asm/preempt.h:7, from ./include/linux/preempt.h:78, from ./include/linux/spinlock.h:51, from ./include/linux/seqlock.h:36, from ./include/linux/time.h:6, from ./include/linux/stat.h:19,
Quoted 8 lines
from ./include/linux/module.h:10,
from block/blk-merge.c:6:
./include/asm-generic/memory_model.h:55:52: warning: ‘bvec.bv_page’ may be used uninitialized in this function [-Wmaybe-uninitialized]
#define __page_to_pfn(page) (unsigned long)((page) - vmemmap)
^
block/blk-merge.c:530:17: note: ‘bvec.bv_page’ was declared here
struct bio_vec bvec, bvprv = { NULL };
^~~~It is one issue only if one bio doesn't include any bvec, I will post a patch soon to fix it.
Thanks,
Ming