mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
libdm: ensure first extent is always counted
If FIEMAP returns a single extent after the first call, no extent boundary is detected and the first extent is not counted by the normal mechanism. In this case, increment nr_extents at the same time the extent is added to the region table, before returning.
This commit is contained in:
parent
fce7449d73
commit
f4401fe351
@ -4286,8 +4286,10 @@ static uint64_t _stats_map_extents(struct dm_pool *mem,
|
|||||||
* If the file only has a single extent, no boundary is ever
|
* If the file only has a single extent, no boundary is ever
|
||||||
* detected to trigger addition of the first extent.
|
* detected to trigger addition of the first extent.
|
||||||
*/
|
*/
|
||||||
if (fm_ext[i - 1].fe_logical == 0)
|
if (fm_ext[i - 1].fe_logical == 0) {
|
||||||
_stats_add_extent(mem, fm_pending, nr_extents);
|
_stats_add_extent(mem, fm_pending, nr_extents);
|
||||||
|
nr_extents++;
|
||||||
|
}
|
||||||
|
|
||||||
fiemap->fm_start = (fm_ext[i - 1].fe_logical +
|
fiemap->fm_start = (fm_ext[i - 1].fe_logical +
|
||||||
fm_ext[i - 1].fe_length);
|
fm_ext[i - 1].fe_length);
|
||||||
|
Loading…
Reference in New Issue
Block a user