mirror of
git://sourceware.org/git/lvm2.git
synced 2025-03-22 06:50:52 +03:00
cov: validate pagesize is not negative
As _init_free_list() cannot accept negative numbers
This commit is contained in:
parent
8bea252a63
commit
7232458b6c
@ -1040,6 +1040,11 @@ struct bcache *bcache_create(sector_t block_sectors, unsigned nr_cache_blocks,
|
||||
unsigned max_io = engine->max_io(engine);
|
||||
long pgsize = sysconf(_SC_PAGESIZE);
|
||||
|
||||
if ((pgsize = sysconf(_SC_PAGESIZE)) < 0) {
|
||||
log_warn("bcache cannot read pagesize.");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!nr_cache_blocks) {
|
||||
log_warn("bcache must have at least one cache block");
|
||||
return NULL;
|
||||
|
Loading…
x
Reference in New Issue
Block a user