1
0
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:
Heinz Mauelshagen 2002-02-13 21:28:56 +00:00
parent 00a9d5417a
commit df89b641bb

View File

@ -8,6 +8,7 @@
#include "dbg_malloc.h"
#include "pool.h"
#include "hash.h"
#include "limits.h"
#include "list.h"
#include "log.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)
{
uint64_t max_size = UINT_MAX;
if (lv->le_count > MAX_LE_TOTAL) {
log_error("logical volumes cannot contain more than "
"%d extents.", MAX_LE_TOTAL);
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;
}