Hi,
This new patch skips the quota check when the filesystem is mounted
with the same quota option.
Signed-off-by: Utako Kusaka <utako@xxxxxxxxxxxxxx>
---
--- fs/xfs/quota/xfs_qm.c.orgn 2007-02-22 17:30:07.000000000 +0900
+++ fs/xfs/quota/xfs_qm.c 2007-03-02 15:01:44.000000000 +0900
@@ -1175,7 +1175,12 @@ 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);
+ if (XFS_IS_UQUOTA_ON(mp) && (mp->m_sb.sb_qflags & XFS_UQUOTA_ACCT))
+ mp->m_qflags |= (mp->m_sb.sb_qflags & XFS_UQUOTA_CHKD);
+ if (XFS_IS_GQUOTA_ON(mp) && (mp->m_sb.sb_qflags & XFS_GQUOTA_ACCT))
+ mp->m_qflags |= (mp->m_sb.sb_qflags & XFS_OQUOTA_CHKD);
+ if (XFS_IS_PQUOTA_ON(mp) && (mp->m_sb.sb_qflags & XFS_PQUOTA_ACCT))
+ mp->m_qflags |= (mp->m_sb.sb_qflags & XFS_OQUOTA_CHKD);
/*
* We try to get the limits from the superuser's limits fields.
Fri, 02 Mar 2007 10:26:48 +1100 Donald Douwsma wrote:
>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
>
>
|