All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tristan Ye <tristan.ye@oracle.com>
To: ocfs2-devel@oss.oracle.com
Subject: [Ocfs2-devel] [PATCH 1/1] ocfs2: Add readonly check in ocfs2_quota_on().
Date: Fri, 03 Jun 2011 00:21:14 +0800	[thread overview]
Message-ID: <4DE7B87A.7010307@oracle.com> (raw)
In-Reply-To: <20110602124425.GB5718@quack.suse.cz>

On 06/02/2011 08:44 PM, Jan Kara wrote:
> On Wed 01-06-11 11:25:25, Sunil Mushran wrote:
>> looks good.
>   Yes, looks OK to me as well. Only I'd be interested what NULL pointer
> dereference happened because I don't see how it could. Tristan, do you have
> the trace?

Sure,
	StackTrace attached.
Tristan


> 
> 								Honza
> 
>> On 06/01/2011 01:19 AM, Tristan Ye wrote:
>>> Enabling quota on a readonly ocfs2 fs caused a 'NULL pointer dereference' in
>>> dquot_enable(), a very straightforward fix is to check readonly at the very
>>> beginning of ocfs2_quota_on(), which calls dquot_enable().
>>>
>>> Signed-off-by: Tristan Ye<tristan.ye@oracle.com>
>>> ---
>>>  fs/ocfs2/super.c |    4 ++++
>>>  1 files changed, 4 insertions(+), 0 deletions(-)
>>>
>>> diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c
>>> index 029c4cd..3cade2a 100644
>>> --- a/fs/ocfs2/super.c
>>> +++ b/fs/ocfs2/super.c
>>> @@ -995,6 +995,10 @@ static int ocfs2_quota_on(struct super_block *sb, int type, int format_id)
>>>  	if (!OCFS2_HAS_RO_COMPAT_FEATURE(sb, feature[type]))
>>>  		return -EINVAL;
>>>
>>> +	if (ocfs2_is_hard_readonly(OCFS2_SB(sb))) {
>>> +		return -EROFS;
>>> +	}
>>> +
>>>  	return dquot_enable(sb_dqopt(sb)->files[type], type,
>>>  			    format_id, DQUOT_LIMITS_ENABLED);
>>>  }
>>

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: dquot_enable_oops
Url: http://oss.oracle.com/pipermail/ocfs2-devel/attachments/20110603/c97455ef/attachment.pl 

  reply	other threads:[~2011-06-02 16:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-01  8:19 [Ocfs2-devel] [PATCH 1/1] ocfs2: Add readonly check in ocfs2_quota_on() Tristan Ye
2011-06-01 18:25 ` Sunil Mushran
2011-06-02 12:44   ` Jan Kara
2011-06-02 16:21     ` Tristan Ye [this message]
2011-06-02 16:50       ` Jan Kara
2011-06-03  1:05         ` Tristan Ye
  -- strict thread matches above, loose matches on Subject: below --
2011-06-01  8:15 Tristan Ye

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=4DE7B87A.7010307@oracle.com \
    --to=tristan.ye@oracle.com \
    --cc=ocfs2-devel@oss.oracle.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.