[PATCH] (was: [OOPS] dquot_transfer() - 2.4.0-test8)

From: Martin Diehl (mdiehlcs@compuserve.de)
Date: Sun Sep 10 2000 - 19:29:39 EST


On Mon, 11 Sep 2000, Martin Diehl wrote:

> transfer_to[cnt] is initialized to NODQUOT from the first loop
> (due to several continue's e.g.) when entering the second loop.
> Unfortunately I do not feel familiar enough to the quota code to
> provide a patch for this problem.

well, was a little bit to pessimistic. After some look at the code
I'm pretty sure the obvious check will solve it - succesfully tested
on local UP box.
Somebody with better knowledge of the logic behind dquot_transfer()
should check please, whether any special treatment is needed.

Martin

--- linux-2.4.0-test8/fs/dquot.c.orig Mon Sep 11 01:42:56 2000
+++ linux-2.4.0-test8/fs/dquot.c Mon Sep 11 02:12:04 2000
@@ -1285,12 +1285,15 @@
                 blocks = isize_to_blocks(inode->i_size, BLOCK_SIZE_BITS);
         else
                 blocks = (inode->i_blocks >> 1);
- for (cnt = 0; cnt < MAXQUOTAS; cnt++)
+ for (cnt = 0; cnt < MAXQUOTAS; cnt++) {
+ if (transfer_to[cnt] == NODQUOT)
+ continue;
                 if (check_idq(transfer_to[cnt], 1) == NO_QUOTA ||
                     check_bdq(transfer_to[cnt], blocks, 0) == NO_QUOTA) {
                         cnt = MAXQUOTAS;
                         goto put_all;
                 }
+ }
 
         if ((error = notify_change(dentry, iattr)))
                 goto put_all;

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Fri Sep 15 2000 - 21:00:14 EST