summaryrefslogtreecommitdiffstats
path: root/fs/ext4/mballoc.c
diff options
context:
space:
mode:
authorLukas Czerner <lczerner@redhat.com>2010-10-28 03:30:04 +0200
committerTheodore Ts'o <tytso@mit.edu>2010-10-28 03:30:04 +0200
commit53fdcf992d616484d388a8ab9dad07dc8b8f1178 (patch)
treef9542d11f725bfb552636f53eab455f917138f47 /fs/ext4/mballoc.c
parentext4: check for negative error code from sb_issue_discard (diff)
downloadlinux-53fdcf992d616484d388a8ab9dad07dc8b8f1178.tar.xz
linux-53fdcf992d616484d388a8ab9dad07dc8b8f1178.zip
ext4: don't hold spinlock while calling ext4_issue_discard()
We can't hold the block group spinlock because we ext4_issue_discard() calls wait and hence can get rescheduled. Google-Bug-Id: 3017678 Signed-off-by: Lukas Czerner <lczerner@redhat.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to '')
-rw-r--r--fs/ext4/mballoc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
index 53472e27b327..ccdfec6acb75 100644
--- a/fs/ext4/mballoc.c
+++ b/fs/ext4/mballoc.c
@@ -4696,12 +4696,12 @@ do_more:
* with group lock held. generate_buddy look at
* them with group lock_held
*/
+ if (test_opt(sb, DISCARD))
+ ext4_issue_discard(sb, block_group, bit, count);
ext4_lock_group(sb, block_group);
mb_clear_bits(bitmap_bh->b_data, bit, count);
mb_free_blocks(inode, &e4b, bit, count);
ext4_mb_return_to_preallocation(inode, &e4b, block, count);
- if (test_opt(sb, DISCARD))
- ext4_issue_discard(sb, block_group, bit, count);
}
ret = ext4_free_blks_count(sb, gdp) + count;