mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-03 05:18:29 +03:00
LV maximum size limit of 2TB ensured in _lv_setup()
This commit is contained in:
parent
00a9d5417a
commit
df89b641bb
@ -8,6 +8,7 @@
|
|||||||
#include "dbg_malloc.h"
|
#include "dbg_malloc.h"
|
||||||
#include "pool.h"
|
#include "pool.h"
|
||||||
#include "hash.h"
|
#include "hash.h"
|
||||||
|
#include "limits.h"
|
||||||
#include "list.h"
|
#include "list.h"
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
#include "display.h"
|
#include "display.h"
|
||||||
@ -406,11 +407,20 @@ static int _pv_setup(struct format_instance *fi, struct physical_volume *pv,
|
|||||||
|
|
||||||
static int _lv_setup(struct format_instance *fi, struct logical_volume *lv)
|
static int _lv_setup(struct format_instance *fi, struct logical_volume *lv)
|
||||||
{
|
{
|
||||||
|
uint64_t max_size = UINT_MAX;
|
||||||
|
|
||||||
if (lv->le_count > MAX_LE_TOTAL) {
|
if (lv->le_count > MAX_LE_TOTAL) {
|
||||||
log_error("logical volumes cannot contain more than "
|
log_error("logical volumes cannot contain more than "
|
||||||
"%d extents.", MAX_LE_TOTAL);
|
"%d extents.", MAX_LE_TOTAL);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
printf ( "lv->size: %" PRIu64 " max_size: %" PRIu64 "\n", lv->size, max_size);
|
||||||
|
if (lv->size > max_size) {
|
||||||
|
char *dummy = display_size(max_size, SIZE_SHORT);
|
||||||
|
log_error("logical volumes cannot be larger than %s", dummy);
|
||||||
|
dbg_free(dummy);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user