From: Eric Bollengier Date: Tue, 20 Feb 2007 16:39:46 +0000 (+0000) Subject: ebl verify MaxVols when moving recycled volumes to RecyclePool X-Git-Tag: Release-7.0.0~6854 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=1d31b8f3344f4203a7530eceb543a79fb35fc4c6;p=bacula%2Fbacula ebl verify MaxVols when moving recycled volumes to RecyclePool git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@4226 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/src/dird/ua_purge.c b/bacula/src/dird/ua_purge.c index 14c77edafe..f41156558d 100644 --- a/bacula/src/dird/ua_purge.c +++ b/bacula/src/dird/ua_purge.c @@ -614,8 +614,18 @@ bool mark_media_purged(UAContext *ua, MEDIA_DBR *mr) memset(&newpr, 0, sizeof(POOL_DBR)); newpr.PoolId = mr->RecyclePoolId; oldpr.PoolId = mr->PoolId; - if (db_get_pool_record(jcr, ua->db, &oldpr) && db_get_pool_record(jcr, ua->db, &newpr)) { - update_vol_pool(ua, newpr.Name, mr, &oldpr); + if ( db_get_pool_record(jcr, ua->db, &oldpr) + && db_get_pool_record(jcr, ua->db, &newpr)) + { + /* check if destination pool size is ok */ + if (newpr.MaxVols > 0 && newpr.NumVols >= newpr.MaxVols) { + bsendmsg(ua, _("Unable move recycled Volume in full " + "Pool \"%s\" MaxVols=%d\n"), + newpr.Name, newpr.MaxVols); + + } else { /* move media */ + update_vol_pool(ua, newpr.Name, mr, &oldpr); + } } else { bsendmsg(ua, "%s", db_strerror(ua->db)); }