mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-06 14:48:06 +00:00
Btrfs: fix unlock in __start_delalloc_inodes()
This patch fix a regression caused by the following patch: Btrfs: don't flush all delalloc inodes when we doesn't get s_umount lock break while loop will make us call @spin_unlock() without calling @spin_lock() before, fix it. Signed-off-by: Wang Shilong <wangsl.fnst@cn.fujitsu.com> Reviewed-by: David Sterba <dsterba@suse.cz> Signed-off-by: Chris Mason <clm@fb.com>
This commit is contained in:
parent
3b080b2564
commit
a1ecaabbf9
1 changed files with 3 additions and 2 deletions
|
@ -8500,19 +8500,20 @@ static int __start_delalloc_inodes(struct btrfs_root *root, int delay_iput,
|
||||||
else
|
else
|
||||||
iput(inode);
|
iput(inode);
|
||||||
ret = -ENOMEM;
|
ret = -ENOMEM;
|
||||||
break;
|
goto out;
|
||||||
}
|
}
|
||||||
list_add_tail(&work->list, &works);
|
list_add_tail(&work->list, &works);
|
||||||
btrfs_queue_work(root->fs_info->flush_workers,
|
btrfs_queue_work(root->fs_info->flush_workers,
|
||||||
&work->work);
|
&work->work);
|
||||||
ret++;
|
ret++;
|
||||||
if (nr != -1 && ret >= nr)
|
if (nr != -1 && ret >= nr)
|
||||||
break;
|
goto out;
|
||||||
cond_resched();
|
cond_resched();
|
||||||
spin_lock(&root->delalloc_lock);
|
spin_lock(&root->delalloc_lock);
|
||||||
}
|
}
|
||||||
spin_unlock(&root->delalloc_lock);
|
spin_unlock(&root->delalloc_lock);
|
||||||
|
|
||||||
|
out:
|
||||||
list_for_each_entry_safe(work, next, &works, list) {
|
list_for_each_entry_safe(work, next, &works, list) {
|
||||||
list_del_init(&work->list);
|
list_del_init(&work->list);
|
||||||
btrfs_wait_and_free_delalloc_work(work);
|
btrfs_wait_and_free_delalloc_work(work);
|
||||||
|
|
Loading…
Add table
Reference in a new issue