From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com ([209.132.183.28]:55248 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751133AbdAIIzP (ORCPT ); Mon, 9 Jan 2017 03:55:15 -0500 Date: Mon, 9 Jan 2017 16:55:14 +0800 From: Eryu Guan Subject: Re: [PATCH 4/7] reflink: fix quota tests to work properly Message-ID: <20170109085514.GZ1859@eguan.usersys.redhat.com> References: <148357827617.7677.15595044775254927245.stgit@birch.djwong.org> <148357830178.7677.13949115107817848755.stgit@birch.djwong.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <148357830178.7677.13949115107817848755.stgit@birch.djwong.org> Sender: linux-xfs-owner@vger.kernel.org List-ID: List-Id: xfs To: "Darrick J. Wong" Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org On Wed, Jan 04, 2017 at 05:05:01PM -0800, Darrick J. Wong wrote: > Fix the reflink quota tests to su to the fsgqa user so that we actually > test enforcement of quotas. Seems that XFS enforces user quotas even > if root is writing to a user file, whereas everything else lets root > writes through. Also clean up some of the variable usage and > _require_user. > > Signed-off-by: Darrick J. Wong > --- > v2: Refactor the quota block reporting into a helper function and > port all the existing tests. Fix "fsgqa"/$qa_user usage too. > --- > common/quota | 10 ++++++++++ > tests/generic/305 | 22 ++++++++++------------ > tests/generic/305.out | 30 +++++++++++++++--------------- > tests/generic/326 | 22 ++++++++++------------ > tests/generic/326.out | 30 +++++++++++++++--------------- > tests/generic/327 | 19 +++++++++---------- > tests/generic/327.out | 12 ++++++------ > tests/generic/328 | 29 ++++++++++++++--------------- > tests/generic/328.out | 28 ++++++++++++++-------------- > tests/xfs/213 | 22 ++++++++++------------ > tests/xfs/213.out | 30 +++++++++++++++--------------- > tests/xfs/214 | 22 ++++++++++------------ > tests/xfs/214.out | 30 +++++++++++++++--------------- > 13 files changed, 153 insertions(+), 153 deletions(-) > > > diff --git a/common/quota b/common/quota > index d4ae861..5c6e680 100644 > --- a/common/quota > +++ b/common/quota > @@ -302,5 +302,15 @@ _check_quota_usage() > } > } > > +# Report the block usage of root, $qa_user, and nobody > +_report_quota_blocks() { > + repquota $SCRATCH_MNT | egrep "^($qa_user|root|nobody)" | awk '{print $1, $3, $4, $5}' > +} > + > +# Report the inode usage of root, $qa_user, and nobody > +_report_quota_inodes() { > + repquota $SCRATCH_MNT | egrep "^($qa_user|root|nobody)" | awk '{print $1, $6, $7, $8}' > +} > + Name them as _scratch_report_quota_blocks|inodes ? Since they're assuming mount point is SCRATCH_MNT. Or take the mount point as the first argument? Thanks, Eryu