summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--fs/dquot.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/fs/dquot.c b/fs/dquot.c
index f3c0f63265c3..edda8c2009d6 100644
--- a/fs/dquot.c
+++ b/fs/dquot.c
@@ -1011,9 +1011,12 @@ warn_put_all:
spin_unlock(&dq_data_lock);
flush_warnings(transfer_to, warntype);
- for (cnt = 0; cnt < MAXQUOTAS; cnt++)
- if (transfer_from[cnt] != NODQUOT)
+ for (cnt = 0; cnt < MAXQUOTAS; cnt++) {
+ if (ret == QUOTA_OK && transfer_from[cnt] != NODQUOT)
dqput(transfer_from[cnt]);
+ if (ret == NO_QUOTA && transfer_to[cnt] != NODQUOT)
+ dqput(transfer_to[cnt]);
+ }
up_write(&sb_dqopt(inode->i_sb)->dqptr_sem);
return ret;
}