From: Christoph Hellwig <hch@infradead.org>
To: Arkadiusz Miskiewicz <arekm@maven.pl>
Cc: xfs@oss.sgi.com
Subject: Re: 2.6.38.8: quota check oops
Date: Thu, 7 Jul 2011 09:11:48 -0400 [thread overview]
Message-ID: <20110707131148.GA21278@infradead.org> (raw)
In-Reply-To: <201107060832.03640.arekm@maven.pl>
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@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
prev parent reply other threads:[~2011-07-07 13:11 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-06 6:32 2.6.38.8: quota check oops Arkadiusz Miskiewicz
2011-07-07 13:11 ` Christoph Hellwig [this message]
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=20110707131148.GA21278@infradead.org \
--to=hch@infradead.org \
--cc=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