* [PATCH] dquot_transfer() fix
@ 2003-05-07 16:17 Jan Kara
0 siblings, 0 replies; only message in thread
From: Jan Kara @ 2003-05-07 16:17 UTC (permalink / raw)
To: torvalds; +Cc: linux-kernel
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;
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2003-05-07 16:04 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-05-07 16:17 [PATCH] dquot_transfer() fix Jan Kara
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).