From 1d31b8f3344f4203a7530eceb543a79fb35fc4c6 Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Tue, 20 Feb 2007 16:39:46 +0000 Subject: [PATCH] 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 --- bacula/src/dird/ua_purge.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) 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)); } -- 2.39.5