From: Michal Rakowski Date: Tue, 23 Nov 2021 15:34:36 +0000 (+0100) Subject: Fix #8356 About very small max volume size X-Git-Tag: Beta-15.0.0~757 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=62ce3668133780e0ed63cbe33c37cf88a58f2f09;p=thirdparty%2Fbacula.git Fix #8356 About very small max volume size --- diff --git a/bacula/src/dird/dird.c b/bacula/src/dird/dird.c index e2ab105ef..8e9c0b91d 100644 --- a/bacula/src/dird/dird.c +++ b/bacula/src/dird/dird.c @@ -1322,6 +1322,14 @@ static bool check_resources() pool->name()); OK = false; } + + if (pool->MaxVolBytes && (pool->MaxVolBytes < 1024*1024)) { + Jmsg(NULL, M_FATAL, 0, + _("Invalid (too small) MaximumVolumeBytes: %llu for pool: %s. " + "MaxVolBytes should be bigger or equal to 1048576 bytes\n"), + pool->MaxVolBytes, pool->hdr.name); + OK = false; + } } /* verify a Collector resource */ diff --git a/bacula/src/stored/stored.c b/bacula/src/stored/stored.c index 58308bedd..7f32d1a86 100644 --- a/bacula/src/stored/stored.c +++ b/bacula/src/stored/stored.c @@ -434,6 +434,16 @@ static int check_resources() OK = false; } + foreach_res(device, R_DEVICE) { + if (device->max_volume_size && (device->max_volume_size < 1024*1024)) { + Jmsg(NULL, M_FATAL, 0, + _("Invalid (too small) MaximumVolumeSize: %llu for device: %s. " + "MaxVolSize should be bigger or equal to 1048576 bytes\n"), + device->max_volume_size, device->hdr.name); + OK = false; + } + } + if (me && !me->messages) { me->messages = (MSGS *)GetNextRes(R_MSGS, NULL); if (!me->messages) {