]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/ext4/mballoc.c
ext4: Retry block reservation
[linux-2.6-omap-h63xx.git] / fs / ext4 / mballoc.c
index 2c10b5058a8da7d4604173310155cfb0427bc639..e4f30de11a9dcd14e53e18d17718ffcf0fa8e170 100644 (file)
@@ -4395,7 +4395,12 @@ ext4_fsblk_t ext4_mb_new_blocks(handle_t *handle,
                /*
                 * With delalloc we already reserved the blocks
                 */
-               if (ext4_claim_free_blocks(sbi, ar->len)) {
+               while (ar->len && ext4_claim_free_blocks(sbi, ar->len)) {
+                       /* let others to free the space */
+                       yield();
+                       ar->len = ar->len >> 1;
+               }
+               if (!ar->len) {
                        *errp = -ENOSPC;
                        return 0;
                }