summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2010-10-11 15:22:21 +0200
committerJan Kara <jack@suse.cz>2010-10-28 01:30:03 +0200
commit86f3cbec4a193c04d0a31c13132c5956731af6ff (patch)
tree6bc3f57914b07672b73320dc9604a40b8e3ffea5
parent9e32784b71c2c84895016ca6ab271591669c02aa (diff)
downloadop-kernel-dev-86f3cbec4a193c04d0a31c13132c5956731af6ff.zip
op-kernel-dev-86f3cbec4a193c04d0a31c13132c5956731af6ff.tar.gz
quota: Fix issuing of warnings from dquot_transfer
__dquot_transfer accidentally called flush_warnings for a wrong set of dquots which could result in quota warnings being issued with a wrong identification. Also when operation fails because of EDQUOT, there's no need check for issuing information message about user getting below limits (no transfer has actually happened). Signed-off-by: Jan Kara <jack@suse.cz>
-rw-r--r--fs/quota/dquot.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c
index ed14bee..1bc38f5 100644
--- a/fs/quota/dquot.c
+++ b/fs/quota/dquot.c
@@ -1805,20 +1805,19 @@ int __dquot_transfer(struct inode *inode, struct dquot **transfer_to)
mark_all_dquot_dirty(transfer_from);
mark_all_dquot_dirty(transfer_to);
+ flush_warnings(transfer_to, warntype_to);
+ flush_warnings(transfer_from, warntype_from_inodes);
+ flush_warnings(transfer_from, warntype_from_space);
/* Pass back references to put */
for (cnt = 0; cnt < MAXQUOTAS; cnt++)
if (is_valid[cnt])
transfer_to[cnt] = transfer_from[cnt];
-
-warn:
- flush_warnings(transfer_to, warntype_to);
- flush_warnings(transfer_from, warntype_from_inodes);
- flush_warnings(transfer_from, warntype_from_space);
- return ret;
+ return 0;
over_quota:
spin_unlock(&dq_data_lock);
up_write(&sb_dqopt(inode->i_sb)->dqptr_sem);
- goto warn;
+ flush_warnings(transfer_to, warntype_to);
+ return ret;
}
EXPORT_SYMBOL(__dquot_transfer);
OpenPOWER on IntegriCloud