mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-02 01:18:26 +03:00
Fix conversion of md chunk size into sectors.
This commit is contained in:
parent
2adafc1699
commit
9c4bf5db4a
@ -1,7 +1,8 @@
|
|||||||
Version 2.02.41 -
|
Version 2.02.41 -
|
||||||
=====================================
|
=====================================
|
||||||
|
Fix conversion of md chunk size into sectors.
|
||||||
Free text metadata buffer after a failure writing it.
|
Free text metadata buffer after a failure writing it.
|
||||||
Fix misleading error message when there is no allocatable extents in VG.
|
Fix misleading error message when there are no allocatable extents in VG.
|
||||||
Fix handling of PVs which reappeared with old metadata version.
|
Fix handling of PVs which reappeared with old metadata version.
|
||||||
Fix mirror DSO to call vgreduce with proper parameters.
|
Fix mirror DSO to call vgreduce with proper parameters.
|
||||||
Fix validation of --minor and --major in lvcreate to require -My always.
|
Fix validation of --minor and --major in lvcreate to require -My always.
|
||||||
|
@ -133,7 +133,7 @@ unsigned long dev_md_chunk_size(const char *sysfs_dir, struct device *dev)
|
|||||||
char path[PATH_MAX+1], buffer[64];
|
char path[PATH_MAX+1], buffer[64];
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
struct stat info;
|
struct stat info;
|
||||||
unsigned long chunk_size = 0UL;
|
unsigned long chunk_size_bytes = 0UL;
|
||||||
|
|
||||||
if (MAJOR(dev->dev) != md_major())
|
if (MAJOR(dev->dev) != md_major())
|
||||||
return 0;
|
return 0;
|
||||||
@ -165,20 +165,20 @@ unsigned long dev_md_chunk_size(const char *sysfs_dir, struct device *dev)
|
|||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sscanf(buffer, "%lu", &chunk_size) != 1) {
|
if (sscanf(buffer, "%lu", &chunk_size_bytes) != 1) {
|
||||||
log_error("sysfs file %s not in expected format: %s", path,
|
log_error("sysfs file %s not in expected format: %s", path,
|
||||||
buffer);
|
buffer);
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
log_very_verbose("Found chunksize %lu for md device %s.", chunk_size,
|
log_very_verbose("Device %s md chunk size is %lu bytes.",
|
||||||
dev_name(dev));
|
dev_name(dev), chunk_size_bytes);
|
||||||
|
|
||||||
out:
|
out:
|
||||||
if (fclose(fp))
|
if (fclose(fp))
|
||||||
log_sys_error("fclose", path);
|
log_sys_error("fclose", path);
|
||||||
|
|
||||||
return chunk_size;
|
return chunk_size_bytes >> SECTOR_SHIFT;
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
@ -75,13 +75,18 @@ unsigned long pe_align(struct physical_volume *pv)
|
|||||||
/*
|
/*
|
||||||
* Align to chunk size of underlying md device if present
|
* Align to chunk size of underlying md device if present
|
||||||
*/
|
*/
|
||||||
if (pv->dev &&
|
if (!pv->dev)
|
||||||
find_config_tree_bool(pv->fmt->cmd, "devices/md_chunk_alignment",
|
goto out;
|
||||||
|
|
||||||
|
if (find_config_tree_bool(pv->fmt->cmd, "devices/md_chunk_alignment",
|
||||||
DEFAULT_MD_CHUNK_ALIGNMENT))
|
DEFAULT_MD_CHUNK_ALIGNMENT))
|
||||||
pv->pe_align = MAX(pv->pe_align,
|
pv->pe_align = MAX(pv->pe_align,
|
||||||
dev_md_chunk_size(pv->fmt->cmd->sysfs_dir,
|
dev_md_chunk_size(pv->fmt->cmd->sysfs_dir,
|
||||||
pv->dev));
|
pv->dev));
|
||||||
|
|
||||||
|
log_very_verbose("%s: Setting PE alignment to %lu sectors.",
|
||||||
|
dev_name(pv->dev), pv->pe_align);
|
||||||
|
|
||||||
out:
|
out:
|
||||||
return pv->pe_align;
|
return pv->pe_align;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user