All of lore.kernel.org
 help / color / mirror / Atom feed
* [Ocfs2-devel] [PATCH 1/1] ocfs2: Add readonly check in ocfs2_quota_on().
@ 2011-06-01  8:19 Tristan Ye
  2011-06-01 18:25 ` Sunil Mushran
  0 siblings, 1 reply; 7+ messages in thread
From: Tristan Ye @ 2011-06-01  8:19 UTC (permalink / raw)
  To: ocfs2-devel

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);
 }
-- 
1.5.5

^ permalink raw reply related	[flat|nested] 7+ messages in thread
* [Ocfs2-devel] [PATCH 1/1] ocfs2: Add readonly check in ocfs2_quota_on().
@ 2011-06-01  8:15 Tristan Ye
  0 siblings, 0 replies; 7+ messages in thread
From: Tristan Ye @ 2011-06-01  8:15 UTC (permalink / raw)
  To: ocfs2-devel

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);
 }
-- 
1.5.5

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-06-03  1:05 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

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.