diff options
author | Jan Kara <jack@suse.cz> | 2010-05-13 16:14:53 -0400 |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2010-05-24 08:06:39 -0400 |
commit | eea7feb072f5914ecafa95b3d83be0c229244d90 (patch) | |
tree | c9179933bd14f11f883448bd133876f907c3f50c | |
parent | f4b87dee923342505e1ddba8d34ce9de33e75050 (diff) |
ocfs2: Fix use after free on remount read-only
We also have to cancel quota syncing thread on remount read only because
at that moment quota is being turned off. Otherwise quota syncing thread
will try to access already freed quota structures.
Signed-off-by: Jan Kara <jack@suse.cz>
-rw-r--r-- | fs/ocfs2/super.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c index 2c26ce251cb3..66f9984a983c 100644 --- a/fs/ocfs2/super.c +++ b/fs/ocfs2/super.c | |||
@@ -883,9 +883,15 @@ static int ocfs2_susp_quotas(struct ocfs2_super *osb, int unsuspend) | |||
883 | sb_dqopt(sb)->files[type], | 883 | sb_dqopt(sb)->files[type], |
884 | type, QFMT_OCFS2, | 884 | type, QFMT_OCFS2, |
885 | DQUOT_SUSPENDED); | 885 | DQUOT_SUSPENDED); |
886 | else | 886 | else { |
887 | struct ocfs2_mem_dqinfo *oinfo; | ||
888 | |||
889 | /* Cancel periodic syncing before suspending */ | ||
890 | oinfo = sb_dqinfo(sb, type)->dqi_priv; | ||
891 | cancel_delayed_work_sync(&oinfo->dqi_sync_work); | ||
887 | status = vfs_quota_disable(sb, type, | 892 | status = vfs_quota_disable(sb, type, |
888 | DQUOT_SUSPENDED); | 893 | DQUOT_SUSPENDED); |
894 | } | ||
889 | if (status < 0) | 895 | if (status < 0) |
890 | break; | 896 | break; |
891 | } | 897 | } |