From fc03ebed5ae638d12ddc5aa5479c8d05ef67a3f7 Mon Sep 17 00:00:00 2001 From: Daniel Hokka Zakrisson Date: Wed, 11 Jul 2007 15:27:53 +0000 Subject: [PATCH 1/1] Fix disk limit accounting for ext3 and ext4. --- fs/ext3/balloc.c | 4 ++-- fs/ext4/balloc.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/fs/ext3/balloc.c b/fs/ext3/balloc.c index fd75cf8f7..72e774f8b 100644 --- a/fs/ext3/balloc.c +++ b/fs/ext3/balloc.c @@ -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; diff --git a/fs/ext4/balloc.c b/fs/ext4/balloc.c index 1a666b3c0..79bafb7b0 100644 --- a/fs/ext4/balloc.c +++ b/fs/ext4/balloc.c @@ -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; -- 2.43.0