diff options
author | Jan Kara <jack@suse.cz> | 2010-05-13 12:05:15 -0400 |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2010-05-21 13:30:48 -0400 |
commit | 741e128933448e589a85286e535078b24f4cf568 (patch) | |
tree | 40a069e5c7484673529f0747a9995cc7d2a85f00 /fs/ocfs2/quota_local.c | |
parent | 832d09cf1438bd172f69478bde74f20f05ec0115 (diff) |
ocfs2: Fix NULL pointer deref when writing local dquot
commit_dqblk() can write quota info to global file. That is actually a bad
thing to do because if we are just modifying local quota file, we are not
prepared (do not hold proper locks, do not have transaction credits) to do
a modification of the global quota file. So do not use commit_dqblk() and
instead call our writing function directly.
Acked-by: Joel Becker <Joel.Becker@oracle.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/ocfs2/quota_local.c')
-rw-r--r-- | fs/ocfs2/quota_local.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/ocfs2/quota_local.c b/fs/ocfs2/quota_local.c index 778947f0e951..551a6bff9f2c 100644 --- a/fs/ocfs2/quota_local.c +++ b/fs/ocfs2/quota_local.c | |||
@@ -892,7 +892,7 @@ static void olq_set_dquot(struct buffer_head *bh, void *private) | |||
892 | } | 892 | } |
893 | 893 | ||
894 | /* Write dquot to local quota file */ | 894 | /* Write dquot to local quota file */ |
895 | static int ocfs2_local_write_dquot(struct dquot *dquot) | 895 | int ocfs2_local_write_dquot(struct dquot *dquot) |
896 | { | 896 | { |
897 | struct super_block *sb = dquot->dq_sb; | 897 | struct super_block *sb = dquot->dq_sb; |
898 | struct ocfs2_dquot *od = OCFS2_DQUOT(dquot); | 898 | struct ocfs2_dquot *od = OCFS2_DQUOT(dquot); |
@@ -1309,7 +1309,6 @@ static const struct quota_format_ops ocfs2_format_ops = { | |||
1309 | .read_file_info = ocfs2_local_read_info, | 1309 | .read_file_info = ocfs2_local_read_info, |
1310 | .write_file_info = ocfs2_global_write_info, | 1310 | .write_file_info = ocfs2_global_write_info, |
1311 | .free_file_info = ocfs2_local_free_info, | 1311 | .free_file_info = ocfs2_local_free_info, |
1312 | .commit_dqblk = ocfs2_local_write_dquot, | ||
1313 | }; | 1312 | }; |
1314 | 1313 | ||
1315 | struct quota_format_type ocfs2_quota_format = { | 1314 | struct quota_format_type ocfs2_quota_format = { |