Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 2 Mar 2000 10:25:21 +0100
From:      Andre Albsmeier <andre.albsmeier@mchp.siemens.de>
To:        freebsd-hackers@freebsd.org
Cc:        andre.albsmeier@mchp.siemens.de
Subject:   Re: Fix for quotas grace time when using chown and soft limits are hit again
Message-ID:  <20000302102521.A23506@internal>
In-Reply-To: <20000301221956.A10086@internal>; from andre@internal on Wed, Mar 01, 2000 at 10:19:56PM %2B0100
References:  <20000301221956.A10086@internal>

next in thread | previous in thread | raw e-mail | index | archive | help
[follow up to myself...]

On Wed, 01-Mar-2000 at 22:19:56 +0100, Andre Albsmeier wrote:
> Here is a problem with FreeBSD's quotas that I have observed
> for a long time now but finally found some time to track it down:
> 
> Let's assume the following settings on a quota enabled system:
> 
> soft limits : 100MB
> hard limits : 200MB
> grace period: 7 days
> 
> ...
> 
> --- /sys/ufs/ufs/ufs_quota.c	Mon Aug 30 17:56:23 1999
> +++ ufs_quota.c	Wed Mar  1 21:27:14 2000
> @@ -163,6 +163,10 @@
>  			(void) tsleep((caddr_t)dq, PINOD+1, "chkdq2", 0);
>  		}
>  		dq->dq_curblocks += change;
> /* check if we hit the soft limits */
> +		if (dq->dq_curblocks >= dq->dq_bsoftlimit && dq->dq_bsoftlimit)
> /* check if we have been below the soft limits before */
> +			if (dq->dq_curblocks - change < dq->dq_bsoftlimit)
> /* yes, update the timer */
> +				dq->dq_btime = time_second +
> +				    VFSTOUFS(ITOV(ip)->v_mount)->um_btime[i];
>  		dq->dq_flags |= DQ_MOD;
>  	}
>  	return (0);
> @@ -279,6 +283,10 @@
>  			(void) tsleep((caddr_t)dq, PINOD+1, "chkiq2", 0);
>  		}
>  		dq->dq_curinodes += change;
> /* same as above for inodes */
> +		if (dq->dq_curinodes >= dq->dq_isoftlimit && dq->dq_isoftlimit)
> +			if (dq->dq_curinodes - change < dq->dq_isoftlimit)
> +				dq->dq_itime = time_second +
> +				    VFSTOUFS(ITOV(ip)->v_mount)->um_itime[i];
>  		dq->dq_flags |= DQ_MOD;
>  	}
>  	return (0);
> 

Couldn't stand waiting any longer so I tried it on a test
box and it seems to work :-). However, I am interested in 
hearing the opinion from the filesystem specialists if
the issue:

a) is really a bug
b) can be fixed (changed) with the above patch properly

Thanks to all in advance,

	-Andre


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000302102521.A23506>