Skip to content

Commit

Permalink
ocfs2: Fix use after free on remount read-only
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jan Kara committed May 24, 2010
1 parent f4b87de commit eea7feb
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion fs/ocfs2/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -883,9 +883,15 @@ static int ocfs2_susp_quotas(struct ocfs2_super *osb, int unsuspend)
sb_dqopt(sb)->files[type],
type, QFMT_OCFS2,
DQUOT_SUSPENDED);
else
else {
struct ocfs2_mem_dqinfo *oinfo;

/* Cancel periodic syncing before suspending */
oinfo = sb_dqinfo(sb, type)->dqi_priv;
cancel_delayed_work_sync(&oinfo->dqi_sync_work);
status = vfs_quota_disable(sb, type,
DQUOT_SUSPENDED);
}
if (status < 0)
break;
}
Expand Down

0 comments on commit eea7feb

Please sign in to comment.