mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
topology: handle reported sizes smaller then sector
Recent kernel (4.4) start to report values smaller then sector size (but in reporting size for SSD which support data zeroing on discard). For now log warning and assume it really means 1 sector. Addressing RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=1313377
This commit is contained in:
parent
a494d85ef6
commit
5aade9c402
@ -853,6 +853,12 @@ static unsigned long _dev_topology_attribute(struct dev_types *dt,
|
||||
|
||||
result = value >> SECTOR_SHIFT;
|
||||
|
||||
if (!result && value) {
|
||||
log_warn("WARNING: Device %s: %s is %lu and is unexpectedly less then sector.",
|
||||
dev_name(dev), attribute, value);
|
||||
result = 1;
|
||||
}
|
||||
|
||||
out_close:
|
||||
if (fclose(fp))
|
||||
log_sys_debug("fclose", path);
|
||||
|
Loading…
Reference in New Issue
Block a user