From: Greg Kroah-Hartman Date: Mon, 19 Apr 2010 21:49:55 +0000 (-0700) Subject: .32 quota patch X-Git-Tag: v2.6.32.12~29 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6f934964b0e46ba8cd4f9ee97882cf3c98a56172;p=thirdparty%2Fkernel%2Fstable-queue.git .32 quota patch --- diff --git a/queue-2.6.32/quota-fix-possible-dq_flags-corruption.patch b/queue-2.6.32/quota-fix-possible-dq_flags-corruption.patch new file mode 100644 index 00000000000..d6b526d96eb --- /dev/null +++ b/queue-2.6.32/quota-fix-possible-dq_flags-corruption.patch @@ -0,0 +1,65 @@ +From 08261673cb6dc638c39f44d69b76fffb57b92a8b Mon Sep 17 00:00:00 2001 +From: Andrew Perepechko +Date: Mon, 12 Apr 2010 22:16:50 +0400 +Subject: quota: Fix possible dq_flags corruption + +From: Andrew Perepechko + +commit 08261673cb6dc638c39f44d69b76fffb57b92a8b upstream. + +dq_flags are modified non-atomically in do_set_dqblk via __set_bit calls and +atomically for example in mark_dquot_dirty or clear_dquot_dirty. Hence a +change done by an atomic operation can be overwritten by a change done by a +non-atomic one. Fix the problem by using atomic bitops even in do_set_dqblk. + +Signed-off-by: Andrew Perepechko +Signed-off-by: Jan Kara +Signed-off-by: Greg Kroah-Hartman + +--- + fs/quota/dquot.c | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +--- a/fs/quota/dquot.c ++++ b/fs/quota/dquot.c +@@ -2389,34 +2389,34 @@ static int do_set_dqblk(struct dquot *dq + if (di->dqb_valid & QIF_SPACE) { + dm->dqb_curspace = di->dqb_curspace - dm->dqb_rsvspace; + check_blim = 1; +- __set_bit(DQ_LASTSET_B + QIF_SPACE_B, &dquot->dq_flags); ++ set_bit(DQ_LASTSET_B + QIF_SPACE_B, &dquot->dq_flags); + } + if (di->dqb_valid & QIF_BLIMITS) { + dm->dqb_bsoftlimit = qbtos(di->dqb_bsoftlimit); + dm->dqb_bhardlimit = qbtos(di->dqb_bhardlimit); + check_blim = 1; +- __set_bit(DQ_LASTSET_B + QIF_BLIMITS_B, &dquot->dq_flags); ++ set_bit(DQ_LASTSET_B + QIF_BLIMITS_B, &dquot->dq_flags); + } + if (di->dqb_valid & QIF_INODES) { + dm->dqb_curinodes = di->dqb_curinodes; + check_ilim = 1; +- __set_bit(DQ_LASTSET_B + QIF_INODES_B, &dquot->dq_flags); ++ set_bit(DQ_LASTSET_B + QIF_INODES_B, &dquot->dq_flags); + } + if (di->dqb_valid & QIF_ILIMITS) { + dm->dqb_isoftlimit = di->dqb_isoftlimit; + dm->dqb_ihardlimit = di->dqb_ihardlimit; + check_ilim = 1; +- __set_bit(DQ_LASTSET_B + QIF_ILIMITS_B, &dquot->dq_flags); ++ set_bit(DQ_LASTSET_B + QIF_ILIMITS_B, &dquot->dq_flags); + } + if (di->dqb_valid & QIF_BTIME) { + dm->dqb_btime = di->dqb_btime; + check_blim = 1; +- __set_bit(DQ_LASTSET_B + QIF_BTIME_B, &dquot->dq_flags); ++ set_bit(DQ_LASTSET_B + QIF_BTIME_B, &dquot->dq_flags); + } + if (di->dqb_valid & QIF_ITIME) { + dm->dqb_itime = di->dqb_itime; + check_ilim = 1; +- __set_bit(DQ_LASTSET_B + QIF_ITIME_B, &dquot->dq_flags); ++ set_bit(DQ_LASTSET_B + QIF_ITIME_B, &dquot->dq_flags); + } + + if (check_blim) { diff --git a/queue-2.6.32/series b/queue-2.6.32/series index 19a476b72ab..7ed05559014 100644 --- a/queue-2.6.32/series +++ b/queue-2.6.32/series @@ -124,3 +124,4 @@ x86-fix-breakage-of-uml-from-the-changes-in-the-rwsem-system.patch x86-64-rwsem-avoid-store-forwarding-hazard-in-__downgrade_write.patch fix-nfs4-handling-of-mountpoint-stat.patch dm-mpath-fix-stall-when-requeueing-io.patch +quota-fix-possible-dq_flags-corruption.patch