public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: "Arkadiusz Miśkiewicz" <arekm@maven.pl>
To: xfs@oss.sgi.com
Subject: Re: usrquota, prjquota mount success on 3.16rc4 but Failed to initialize disk quotas on 3.10.43
Date: Tue, 8 Jul 2014 15:27:23 +0200	[thread overview]
Message-ID: <201407081527.24119.arekm@maven.pl> (raw)
In-Reply-To: <201407081041.02020.arekm@maven.pl>

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

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

  reply	other threads:[~2014-07-08 13:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-08  8:41 usrquota, prjquota mount success on 3.16rc4 but Failed to initialize disk quotas on 3.10.43 Arkadiusz Miśkiewicz
2014-07-08 13:27 ` Arkadiusz Miśkiewicz [this message]
2014-07-08 21:49   ` Arkadiusz Miśkiewicz
2014-07-09  0:32     ` Dave Chinner
2014-07-08 13:56 ` Arkadiusz Miśkiewicz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201407081527.24119.arekm@maven.pl \
    --to=arekm@maven.pl \
    --cc=xfs@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox