From: Eric Bollengier Date: Fri, 24 Apr 2020 15:57:02 +0000 (+0200) Subject: BEE Backport bacula/src/dird/newvol.c X-Git-Tag: Release-11.3.2~1754 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3d2b19f97fa2220d71c0fb9949cf478855734375;p=thirdparty%2Fbacula.git BEE Backport bacula/src/dird/newvol.c --- diff --git a/bacula/src/dird/newvol.c b/bacula/src/dird/newvol.c index 7d33464161..7cf7c1fc4b 100644 --- a/bacula/src/dird/newvol.c +++ b/bacula/src/dird/newvol.c @@ -53,6 +53,7 @@ bool newVolume(JCR *jcr, MEDIA_DBR *mr, STORE *store, POOL_MEM &errmsg) /* See if we can create a new Volume */ db_lock(jcr->db); pr.PoolId = mr->PoolId; + pr.PoolBytes = 1; /* Get the size of the pool */ if (!db_get_pool_numvols(jcr, jcr->db, &pr)) { goto bail_out; @@ -64,6 +65,12 @@ bool newVolume(JCR *jcr, MEDIA_DBR *mr, STORE *store, POOL_MEM &errmsg) goto bail_out; } + if (check_max_pool_bytes(&pr)) { + Mmsg(errmsg, "Maximum Pool Bytes exceeded for Pool %s", pr.Name); + Dmsg1(90, "Too much bytes for Pool %s\n", pr.Name); + goto bail_out; + } + mr->clear(); set_pool_dbr_defaults_in_media_dbr(mr, &pr); jcr->VolumeName[0] = 0;