mirror of
git://sourceware.org/git/lvm2.git
synced 2025-03-10 16:58:47 +03:00
cov: add check for positive value
As pgsize parameter for _init_free_list() can't be negative, report problem in case for any reason we would get negative number.
This commit is contained in:
parent
9b71212262
commit
eb566e034f
@ -881,6 +881,11 @@ struct bcache *bcache_create(sector_t block_sectors, unsigned nr_cache_blocks,
|
|||||||
unsigned max_io = engine->max_io(engine);
|
unsigned max_io = engine->max_io(engine);
|
||||||
long pgsize = sysconf(_SC_PAGESIZE);
|
long pgsize = sysconf(_SC_PAGESIZE);
|
||||||
|
|
||||||
|
if (pgsize < 0) {
|
||||||
|
log_warn("WARNING: _SC_PAGESIZE returns negative value.");
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
if (!nr_cache_blocks) {
|
if (!nr_cache_blocks) {
|
||||||
log_warn("bcache must have at least one cache block");
|
log_warn("bcache must have at least one cache block");
|
||||||
return NULL;
|
return NULL;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user