mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-05 02:19:51 +00:00
Btrfs: fix freeze vs auto defrag
If we freeze the fs, the auto defragment should not run. Fix it. Signed-off-by: Miao Xie <miaox@cn.fujitsu.com> Signed-off-by: Chris Mason <chris.mason@fusionio.com>
This commit is contained in:
parent
26176e7c2a
commit
b66f00da0c
1 changed files with 3 additions and 0 deletions
|
@ -318,8 +318,11 @@ static int __btrfs_run_defrag_inode(struct btrfs_fs_info *fs_info,
|
||||||
memset(&range, 0, sizeof(range));
|
memset(&range, 0, sizeof(range));
|
||||||
range.len = (u64)-1;
|
range.len = (u64)-1;
|
||||||
range.start = defrag->last_offset;
|
range.start = defrag->last_offset;
|
||||||
|
|
||||||
|
sb_start_write(fs_info->sb);
|
||||||
num_defrag = btrfs_defrag_file(inode, NULL, &range, defrag->transid,
|
num_defrag = btrfs_defrag_file(inode, NULL, &range, defrag->transid,
|
||||||
BTRFS_DEFRAG_BATCH);
|
BTRFS_DEFRAG_BATCH);
|
||||||
|
sb_end_write(fs_info->sb);
|
||||||
/*
|
/*
|
||||||
* if we filled the whole defrag batch, there
|
* if we filled the whole defrag batch, there
|
||||||
* must be more work to do. Queue this defrag
|
* must be more work to do. Queue this defrag
|
||||||
|
|
Loading…
Reference in a new issue