>From 0babe605cb5b71bec811c7c8676c3f6a97b148d4 Mon Sep 17 00:00:00 2001 From: Jan Kara Date: Thu, 31 Oct 2013 21:22:57 +0100 Subject: [PATCH] Sprinkle some might_sleep() checks into the code. Signed-off-by: Jan Kara --- fs/ext4/mballoc.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c index a41e3ba8cfaa..8b6bdb975e10 100644 --- a/fs/ext4/mballoc.c +++ b/fs/ext4/mballoc.c @@ -4757,6 +4757,7 @@ do_more: if (err) goto error_return; + might_sleep(); if ((flags & EXT4_FREE_BLOCKS_METADATA) && ext4_handle_valid(handle)) { struct ext4_free_data *new_entry; /* @@ -4764,6 +4765,7 @@ do_more: * be used until this transaction is committed */ retry: + might_sleep(); new_entry = kmem_cache_alloc(ext4_free_data_cachep, GFP_NOFS); if (!new_entry) { /* @@ -4779,6 +4781,7 @@ do_more: new_entry->efd_count = count_clusters; new_entry->efd_tid = handle->h_transaction->t_tid; + might_sleep(); ext4_lock_group(sb, block_group); mb_clear_bits(bitmap_bh->b_data, bit, count_clusters); ext4_mb_free_metadata(handle, &e4b, new_entry); @@ -4796,7 +4799,7 @@ do_more: err); } - + might_sleep(); ext4_lock_group(sb, block_group); mb_clear_bits(bitmap_bh->b_data, bit, count_clusters); mb_free_blocks(inode, &e4b, bit, count_clusters); @@ -4807,6 +4810,7 @@ do_more: ext4_block_bitmap_csum_set(sb, block_group, gdp, bitmap_bh); ext4_group_desc_csum_set(sb, block_group, gdp); ext4_unlock_group(sb, block_group); + might_sleep(); if (sbi->s_log_groups_per_flex) { ext4_group_t flex_group = ext4_flex_group(sbi, block_group); -- 1.8.1.4