Re: 2.6.38.8: quota check oops

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

 



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)

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


[Index of Archives]     [Linux XFS Devel]     [Linux Filesystem Development]     [Filesystem Testing]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux