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>
This commit is contained in:
parent
5829870982
commit
53fdcf992d
|
@ -4696,12 +4696,12 @@ do_more:
|
||||||
* with group lock held. generate_buddy look at
|
* with group lock held. generate_buddy look at
|
||||||
* them with group lock_held
|
* them with group lock_held
|
||||||
*/
|
*/
|
||||||
|
if (test_opt(sb, DISCARD))
|
||||||
|
ext4_issue_discard(sb, block_group, bit, count);
|
||||||
ext4_lock_group(sb, block_group);
|
ext4_lock_group(sb, block_group);
|
||||||
mb_clear_bits(bitmap_bh->b_data, bit, count);
|
mb_clear_bits(bitmap_bh->b_data, bit, count);
|
||||||
mb_free_blocks(inode, &e4b, bit, count);
|
mb_free_blocks(inode, &e4b, bit, count);
|
||||||
ext4_mb_return_to_preallocation(inode, &e4b, block, 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;
|
ret = ext4_free_blks_count(sb, gdp) + count;
|
||||||
|
|
Loading…
Reference in a new issue