summaryrefslogtreecommitdiffstats
path: root/fs/quota
diff options
context:
space:
mode:
Diffstat (limited to 'fs/quota')
-rw-r--r--fs/quota/dquot.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c
index e1a155e8db15..0393581fe1a3 100644
--- a/fs/quota/dquot.c
+++ b/fs/quota/dquot.c
@@ -339,6 +339,9 @@ int dquot_mark_dquot_dirty(struct dquot *dquot)
339{ 339{
340 int ret = 1; 340 int ret = 1;
341 341
342 if (!test_bit(DQ_ACTIVE_B, &dquot->dq_flags))
343 return 0;
344
342 /* If quota is dirty already, we don't have to acquire dq_list_lock */ 345 /* If quota is dirty already, we don't have to acquire dq_list_lock */
343 if (test_bit(DQ_MOD_B, &dquot->dq_flags)) 346 if (test_bit(DQ_MOD_B, &dquot->dq_flags))
344 return 1; 347 return 1;
@@ -624,11 +627,9 @@ int dquot_writeback_dquots(struct super_block *sb, int type)
624 while (!list_empty(dirty)) { 627 while (!list_empty(dirty)) {
625 dquot = list_first_entry(dirty, struct dquot, 628 dquot = list_first_entry(dirty, struct dquot,
626 dq_dirty); 629 dq_dirty);
627 /* Dirty and inactive can be only bad dquot... */ 630
628 if (!test_bit(DQ_ACTIVE_B, &dquot->dq_flags)) { 631 WARN_ON(!test_bit(DQ_ACTIVE_B, &dquot->dq_flags));
629 clear_dquot_dirty(dquot); 632
630 continue;
631 }
632 /* Now we have active dquot from which someone is 633 /* Now we have active dquot from which someone is
633 * holding reference so we can safely just increase 634 * holding reference so we can safely just increase
634 * use count */ 635 * use count */
@@ -759,7 +760,7 @@ we_slept:
759 return; 760 return;
760 } 761 }
761 /* Need to release dquot? */ 762 /* Need to release dquot? */
762 if (test_bit(DQ_ACTIVE_B, &dquot->dq_flags) && dquot_dirty(dquot)) { 763 if (dquot_dirty(dquot)) {
763 spin_unlock(&dq_list_lock); 764 spin_unlock(&dq_list_lock);
764 /* Commit dquot before releasing */ 765 /* Commit dquot before releasing */
765 ret = dquot->dq_sb->dq_op->write_dquot(dquot); 766 ret = dquot->dq_sb->dq_op->write_dquot(dquot);
@@ -777,8 +778,6 @@ we_slept:
777 } 778 }
778 goto we_slept; 779 goto we_slept;
779 } 780 }
780 /* Clear flag in case dquot was inactive (something bad happened) */
781 clear_dquot_dirty(dquot);
782 if (test_bit(DQ_ACTIVE_B, &dquot->dq_flags)) { 781 if (test_bit(DQ_ACTIVE_B, &dquot->dq_flags)) {
783 spin_unlock(&dq_list_lock); 782 spin_unlock(&dq_list_lock);
784 dquot->dq_sb->dq_op->release_dquot(dquot); 783 dquot->dq_sb->dq_op->release_dquot(dquot);