xfs
[Top] [All Lists]

Re: usrquota,prjquota mount success on 3.16rc4 but Failed to initialize

To: xfs@xxxxxxxxxxx
Subject: Re: usrquota,prjquota mount success on 3.16rc4 but Failed to initialize disk quotas on 3.10.43
From: Arkadiusz MiÅkiewicz <arekm@xxxxxxxx>
Date: Tue, 8 Jul 2014 15:27:23 +0200
Delivered-to: xfs@xxxxxxxxxxx
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=maven.pl; s=maven; h=from:to:subject:date:user-agent:references:in-reply-to:mime-version :content-type:content-transfer-encoding:message-id; bh=JJslId56gcdpI8Qq0U4xsIALlm62lN6Op+CnFktmCl0=; b=J+Bh094VIqnxXRqvi98aM3d/DCRjTiZGLd/iHoBM3Evi0uHURhVLB61I5KKXzhsvZ/ ekeTGcI0ZGiqUcxKZrQZYkRPV+uuYBf0iy0LGwaN4Q/sg0Ea5mpsNfyKYA0a3yF3DK4M xTfy/UJl/rOTYfYRFOBw28EH1fU6PPQOhtehI=
In-reply-to: <201407081041.02020.arekm@xxxxxxxx>
References: <201407081041.02020.arekm@xxxxxxxx>
User-agent: KMail/1.13.7 (Linux/3.16.0-rc4-dirty; KDE/4.13.2; x86_64; ; )
On Tuesday 08 of July 2014, Arkadiusz MiÅkiewicz wrote:
> My broken fs
> http://ixion.pld-linux.org/~arekm/p2/x1/web2-home.metadump.gz
> thanks to "xfsprogs: fixes for 3.2.1" by Dave is now almost in good shape.
> 
> What I found interesting is that repairing it with current git xfs_repair
> and then mounting (-o usrquota,prjquota) on 3.16.0-rc4 gives me:
> 
> [32208.142316] XFS (sdb): Mounting V4 Filesystem
> [32208.205449] XFS (sdb): Ending clean mount
> [32208.258991] XFS (sdb): Quotacheck needed: Please wait.
> [32821.930437] XFS (sdb): Quotacheck: Done.
> 
> Then I umount it and mount again (same options as before) but on 3.10.43
> kernel:
> 
> [  111.325889] XFS (sdb): Mounting Filesystem
> [  111.419331] XFS (sdb): Failed to initialize disk quotas.
> [  111.419339] XFS (sdb): Ending clean mount
> 
> What did change in later kernels that could have meaning here? (so I could
> try to backport that change).
> 
> For testing I mounted again on 3.16 and:
> [33870.472769] XFS (sdb): Mounting V4 Filesystem
> [33870.543539] XFS (sdb): Ending clean mount
> [33870.597791] XFS (sdb): Quotacheck needed: Please wait.
> [34484.332879] XFS (sdb): Quotacheck: Done
> 
> and again on 3.10.43:
> [ 1649.215390] XFS (sdb): Mounting Filesystem
> [ 1649.316894] XFS (sdb): Failed to initialize disk quotas.
> [ 1649.316902] XFS (sdb): Ending clean mount


Fails in xfs_iget at xfs_qm_init_quotainos():

                if (XFS_IS_OQUOTA_ON(mp) &&
                    mp->m_sb.sb_gquotino != NULLFSINO) {
                        ASSERT(mp->m_sb.sb_gquotino > 0);
                        if ((error = xfs_iget(mp, NULL, mp->m_sb.sb_gquotino,
                                             0, 0, &gip))) {
                                if (uip)
                                        IRELE(uip);
                                return XFS_ERROR(error);
                        }
                }

and in xfs_iget:

        /* reject inode numbers outside existing AGs */
        if (!ino || XFS_INO_TO_AGNO(mp, ino) >= mp->m_sb.sb_agcount)
                return EINVAL;


m_sb.sb_gquotino/ino looks to be 0

# xfs_db /dev/sdb -c "sb 0" -c "print" |grep quot
uquotino = 4077961
gquotino = 0
pquotino = 0

and older kernels (testing on 3.10.46 now) seem to be unable to deal with 
this.

Newer kernels survive probably due to this:

   xfs_sb_quota_from_disk(struct xfs_sb *sbp)
{
        /*
         * older mkfs doesn't initialize quota inodes to NULLFSINO. This
         * leads to in-core values having two different values for a quota
         * inode to be invalid: 0 and NULLFSINO. Change it to a single value
         * NULLFSINO.
         *
         * Note that this change affect only the in-core values. These
         * values are not written back to disk unless any quota information
         * is written to the disk. Even in that case, sb_pquotino field is
         * not written to disk unless the superblock supports pquotino.
         */
        if (sbp->sb_uquotino == 0)
                sbp->sb_uquotino = NULLFSINO;
        if (sbp->sb_gquotino == 0)
                sbp->sb_gquotino = NULLFSINO;
        if (sbp->sb_pquotino == 0)
                sbp->sb_pquotino = NULLFSINO;   

so sb_gquotino = NULLFSINO gets set and it never reaches error condition at 
xfs_qm_init_quotainos()

> 
> 
> (there was an additional problems with hangs on quotacheck like
> http://sprunge.us/LYQO (3.16.0-rc3-00006-g16874b2)
> http://sprunge.us/FfhR (3.15.3)
> http://sprunge.us/ObWI (3.10.20)
> but it only happened when doing quotacheck on image mounted via loop.
> Wasn't able to trigger it when using real disk, so blaming loop code for
> now)


-- 
Arkadiusz MiÅkiewicz, arekm / maven.pl

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