xfs
[Top] [All Lists]

Re: [PATCH] repquota does't report correct space usage

To: Utako Kusaka <utako@xxxxxxxxxxxxxx>
Subject: Re: [PATCH] repquota does't report correct space usage
From: Donald Douwsma <donaldd@xxxxxxx>
Date: Fri, 02 Mar 2007 10:26:48 +1100
Cc: xfs@xxxxxxxxxxx
In-reply-to: <200702280733.AA05017@xxxxxxxxxxxxxxxxxxxxxxxx>
References: <200702280733.AA05017@xxxxxxxxxxxxxxxxxxxxxxxx>
Sender: xfs-bounce@xxxxxxxxxxx
User-agent: Thunderbird 1.5.0.9 (X11/20070103)
Utako Kusaka wrote:
> Hi,
> 
> repquota may report incorrect space usage when the filesystem is mounted
> repeatedly with different quota options.
> The cause of the problem is that xfs_qm_quotacheck() is not called because
> the `CHKD' flag in mp->m_qflags is not cleared until it is mounted with 
> no quota option. This patch fixes it.

Good find, I've heard of some problems with quota 'corruption' that may
actually be caused by this.

> --- linux-2.6.20-orgn/fs/xfs/quota/xfs_qm.c.orgn        2007-02-22 
> 17:30:07.000000000 +0900
> +++ linux-2.6.20/fs/xfs/xfs_qm.c        2007-02-22 17:30:58.000000000 +0900
> @@ -1175,8 +1175,6 @@ xfs_qm_init_quotainfo(
>         qinf->qi_dqperchunk = BBTOB(qinf->qi_dqchunklen);
>         do_div(qinf->qi_dqperchunk, sizeof(xfs_dqblk_t));
> 
> -       mp->m_qflags |= (mp->m_sb.sb_qflags & XFS_ALL_QUOTA_CHKD);
> -
>         /*
>          * We try to get the limits from the superuser's limits fields.
>          * This is quite hacky, but it is standard quota practice.

This disables the optimization that skips the quota check for the normal case 
where mount
options have not been changed.

I don't have any quota check performance figures handy but I don't think we can 
loose this
optimization for people with large filesystems/machines.

I think instead we need to clear the individual quota bit when a filesystem is 
mounted
without a particular quota type. This will force a quota check but only when 
the filesystem
is again mounted with that quota type.

Donald




<Prev in Thread] Current Thread [Next in Thread>