Fix disk limit accounting for ext3 and ext4.
authorDaniel Hokka Zakrisson <dhokka@cs.princeton.edu>
Wed, 11 Jul 2007 15:27:53 +0000 (15:27 +0000)
committerDaniel Hokka Zakrisson <dhokka@cs.princeton.edu>
Wed, 11 Jul 2007 15:27:53 +0000 (15:27 +0000)
fs/ext3/balloc.c
fs/ext4/balloc.c

index fd75cf8..72e774f 100644 (file)
@@ -1463,7 +1463,7 @@ ext3_fsblk_t ext3_new_blocks(handle_t *handle, struct inode *inode,
                *errp = -EDQUOT;
                return 0;
        }
-       if (DLIMIT_ALLOC_BLOCK(inode, 1))
+       if (DLIMIT_ALLOC_BLOCK(inode, num))
            goto out_dlimit;
 
        sbi = EXT3_SB(sb);
@@ -1675,7 +1675,7 @@ io_error:
        *errp = -EIO;
 out:
        if (!performed_allocation)
-               DLIMIT_FREE_BLOCK(inode, 1);
+               DLIMIT_FREE_BLOCK(inode, *count);
 out_dlimit:
        if (fatal) {
                *errp = fatal;
index 1a666b3..79bafb7 100644 (file)
@@ -1480,7 +1480,7 @@ ext4_fsblk_t ext4_new_blocks(handle_t *handle, struct inode *inode,
                *errp = -EDQUOT;
                return 0;
        }
-       if (DLIMIT_ALLOC_BLOCK(inode, 1))
+       if (DLIMIT_ALLOC_BLOCK(inode, num))
            goto out_dlimit;
 
        sbi = EXT4_SB(sb);
@@ -1689,7 +1689,7 @@ io_error:
        *errp = -EIO;
 out:
        if (!performed_allocation)
-               DLIMIT_FREE_BLOCK(inode, 1);
+               DLIMIT_FREE_BLOCK(inode, *count);
 out_dlimit:
        if (fatal) {
                *errp = fatal;