[PATCH] dquot_transfer() fix

Jan Kara (jack@suse.cz)
Wed, 7 May 2003 18:17:20 +0200


Hello,

I'm sending a fix which fixes potential problems (dropping references
which were not acquired) when dquot_transfer() fails. Please apply.

Honza

diff -ruNX /home/jack/.kerndiffexclude linux-2.5.68-1-ext3dfix/fs/dquot.c linux-2.5.68-2-dqtransfix/fs/dquot.c
--- linux-2.5.68-1-ext3dfix/fs/dquot.c Sun May 4 12:32:23 2003
+++ linux-2.5.68-2-dqtransfix/fs/dquot.c Wed May 7 14:17:23 2003
@@ -1055,9 +1055,12 @@
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;
}
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/