aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4/balloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ext4/balloc.c')
-rw-r--r--fs/ext4/balloc.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/fs/ext4/balloc.c b/fs/ext4/balloc.c
index 1707850301d..57909882c08 100644
--- a/fs/ext4/balloc.c
+++ b/fs/ext4/balloc.c
@@ -1738,10 +1738,16 @@ ext4_fsblk_t ext4_old_new_blocks(handle_t *handle, struct inode *inode,
1738 /* 1738 /*
1739 * With delalloc we already reserved the blocks 1739 * With delalloc we already reserved the blocks
1740 */ 1740 */
1741 if (ext4_claim_free_blocks(sbi, *count)) { 1741 while (*count && ext4_claim_free_blocks(sbi, *count)) {
1742 /* let others to free the space */
1743 yield();
1744 *count = *count >> 1;
1745 }
1746 if (!*count) {
1742 *errp = -ENOSPC; 1747 *errp = -ENOSPC;
1743 return 0; /*return with ENOSPC error */ 1748 return 0; /*return with ENOSPC error */
1744 } 1749 }
1750 num = *count;
1745 } 1751 }
1746 /* 1752 /*
1747 * Check quota for allocation of this block. 1753 * Check quota for allocation of this block.