xfs
[Top] [All Lists]

Re: 2.6.38.8: quota check oops

To: Arkadiusz Miskiewicz <arekm@xxxxxxxx>
Subject: Re: 2.6.38.8: quota check oops
From: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date: Thu, 7 Jul 2011 09:11:48 -0400
Cc: xfs@xxxxxxxxxxx
In-reply-to: <201107060832.03640.arekm@xxxxxxxx>
References: <201107060832.03640.arekm@xxxxxxxx>
User-agent: Mutt/1.5.21 (2010-09-15)
On Wed, Jul 06, 2011 at 08:32:03AM +0200, Arkadiusz Miskiewicz wrote:
> 
> quota check code (mount with user+group quota) likes to oops
> for me (usually after system hang and hard reset). 
> 
> This is on 2.6.38.8 on top of raid10 soft raid. Mount without
> quota succeeds without a problem.

Looking over the oops mutex_lock is dereferencing a member at offset
0x20 of a structure that unexpectly is a NULL pointer.  The only
mutex_lock calls in xfs_qm_sync are on qi_dqlist_lock, which happens
to be exactly at the offset 0x20 that the oops is complaining about.

So the quick patch below should prevent the OOPS for you and print
a warnings instead, although I'll have to dig a bit deeper to figure
out the root cause.

Index: linux-2.6/fs/xfs/quota/xfs_qm.c
===================================================================
--- linux-2.6.orig/fs/xfs/quota/xfs_qm.c        2011-07-07 15:02:25.206920700 
+0200
+++ linux-2.6/fs/xfs/quota/xfs_qm.c     2011-07-07 15:03:59.576915891 +0200
@@ -939,6 +939,11 @@ xfs_qm_sync(
        restarts = 0;
 
   again:
+       if (!q) {
+               printk("XFS: %s called without valid quotainfo\n", __func__);
+               dump_stack();
+               return 0;
+       }
        mutex_lock(&q->qi_dqlist_lock);
        /*
         * dqpurge_all() also takes the mplist lock and iterate thru all dquots
@@ -1003,6 +1008,12 @@ xfs_qm_sync(
                else if (error)
                        return error;
 
+               if (!q) {
+                       printk("XFS: %s called without valid quotainfo (2)\n",
+                               __func__);
+                       dump_stack();
+                       return 0;
+               }
                mutex_lock(&q->qi_dqlist_lock);
                if (recl != q->qi_dqreclaims) {
                        if (++restarts >= XFS_QM_SYNC_MAX_RESTARTS)

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