Re: [PATCH] common/quota: adjust _qmount_option for gfs2

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]




> On Jun 21, 2025, at 01:38, Zorro Lang <zlang@xxxxxxxxxx> wrote:
> 
> On Tue, Jun 03, 2025 at 12:10:09PM +0800, Su Yue wrote:
>> gfs2 supports mount options 'quota=[off/account/quiet/on]' but
>> 'usrquota' and 'grpquota' are unsupported.
>> So in _qmount_option, transform $OPTS to 'quota=on' first.
>> 
>> Signed-off-by: Su Yue <glass.su@xxxxxxxx>
>> ---
>> common/quota | 7 +++++++
>> 1 file changed, 7 insertions(+)
>> 
>> diff --git a/common/quota b/common/quota
>> index a51386b1dd24..4b8052e07dde 100644
>> --- a/common/quota
>> +++ b/common/quota
>> @@ -283,6 +283,12 @@ _qmount_option()
>> {
>> OPTS=$1
>> 
>> + if [[ "$FSTYP" == gfs2 ]]; then
>> + OPTS=`echo $OPTS \
>> + | sed   -e 's/usrquota/quota=on/g' \
>> + -e 's/grpquota/quota=on/g'`
>> + fi
> 
> There's not response from gfs list. I'm not familiar with gfs2, so I have to
> ask some questions about your patch...

Feel free to communicate : )
> 
> From the manual of gfs2:
>  quota=[off/account/on]
>  Turns quotas on or off for a filesystem. Setting the quotas to be in the "account" state causes the per UID/GID usage statistics to be correctly maintained by the filesystem, limit and warn values are ignored. The default value is "off".
> 
> Looks like there's only one mount option "quota=..." for gfs2. And I didn't
> find a description about project quota, so
> 1. What will gfs2 do if there's a "prjquota" or "pquota"?

The mount will fail if prjquota/pquota is in mount options.
_require_prjquota() should be modified.

> 2. Do you need to replace "noquota" with "quota=off"?

Yes.. I forgot the case.

> 3. And "quota" to "quota=on" ?

The only case "_qmount_option ‘quota’” is tests/xfs/820, not in generic group.

> 4. Have you tried your patch on gfs2, can all quota related generic cases pass/notrun
>   on gfs2?
> 

TBH, not all quota tests run well on gfs2
There was a bug which can cause kernel hang in gfs2 fixed by kernel commit 5a90f8d49922 ("gfs2: Don't start unnecessary transactions during log flush”)
In v6.16-rc1.

> BTW, in this function you can see:
>        # ext4 doesn't _do_ "-o pquota/prjquota" because reasons
>        # Switch it to "quota" to enable mkfs-time pquota

The comment is confusing to me. ext[234] support ‘-o prjquota’ if  MKFS_OPTIONS="-O quota -E quotatype=usrquota:grpquota:prjquota”.

>        if [[ "$FSTYP" == ext[234] ]]; then
>                OPTS=`echo $OPTS \
>                | sed   -e 's/\bpquota/quota/g' \
>                        -e 's/prjquota/quota/g'`
>        # ocfs2 doesn't support "-o projquota"
>        elif [[ "$FSTYP" == ocfs2 ]]; then
>                OPTS=`echo $OPTS | sed -e 's/prjquota//g'`
>        fi
> 
> please move your gfs2 specific codes here ^^, and give it enough comments.

There is one question from me about the _qmount_option() and _qmount()

Not all tests of qgroup use _qmount, some of them call _scratch_mount() directly.
Is this intentional to avoid influenced by other mount options? If It’s not IMO it’s feasible
to convert them to _qmount?

> 
>> +
>> # Replace any user defined quota options
>> # with the quota option that we want.
>> # Simplest to do this rather than delete existing ones first because
>> @@ -300,6 +306,7 @@ _qmount_option()
>> -e 's/\bpquota/QUOTA/g'    \
>> -e 's/prjquota/QUOTA/g'    \
>> -e 's/noquota/QUOTA/g'     \
>> + -e 's/quota=[^, ]*/QUOTA/g' \
> 
> I think you might need a word boundary, e.g. "\bquota=..."

Right.
— 
Su
> 
> Thanks,
> Zorro
> 
>> -e 's/quota/QUOTA/g'       \
>> -e 's/uqnoenforce/QUOTA/g' \
>> -e 's/gqnoenforce/QUOTA/g' \
>> -- 
>> 2.48.1







[Index of Archives]     [Linux Filesystems Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux