diff options
author | Wang Shilong <wangsl.fnst@cn.fujitsu.com> | 2014-04-02 07:53:32 -0400 |
---|---|---|
committer | Chris Mason <clm@fb.com> | 2014-04-07 12:08:50 -0400 |
commit | a1ecaabbf90cf4e93eb2b50aef3d07ab630c6fb1 (patch) | |
tree | be79e536c83d72f455c25971f20cf99c511d59ae /fs | |
parent | 3b080b2564287be91605bfd1d5ee985696e61d3c (diff) |
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>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/btrfs/inode.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index fdb8f4486e85..0c0bb450cbba 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c | |||
@@ -8500,19 +8500,20 @@ static int __start_delalloc_inodes(struct btrfs_root *root, int delay_iput, | |||
8500 | else | 8500 | else |
8501 | iput(inode); | 8501 | iput(inode); |
8502 | ret = -ENOMEM; | 8502 | ret = -ENOMEM; |
8503 | break; | 8503 | goto out; |
8504 | } | 8504 | } |
8505 | list_add_tail(&work->list, &works); | 8505 | list_add_tail(&work->list, &works); |
8506 | btrfs_queue_work(root->fs_info->flush_workers, | 8506 | btrfs_queue_work(root->fs_info->flush_workers, |
8507 | &work->work); | 8507 | &work->work); |
8508 | ret++; | 8508 | ret++; |
8509 | if (nr != -1 && ret >= nr) | 8509 | if (nr != -1 && ret >= nr) |
8510 | break; | 8510 | goto out; |
8511 | cond_resched(); | 8511 | cond_resched(); |
8512 | spin_lock(&root->delalloc_lock); | 8512 | spin_lock(&root->delalloc_lock); |
8513 | } | 8513 | } |
8514 | spin_unlock(&root->delalloc_lock); | 8514 | spin_unlock(&root->delalloc_lock); |
8515 | 8515 | ||
8516 | out: | ||
8516 | list_for_each_entry_safe(work, next, &works, list) { | 8517 | list_for_each_entry_safe(work, next, &works, list) { |
8517 | list_del_init(&work->list); | 8518 | list_del_init(&work->list); |
8518 | btrfs_wait_and_free_delalloc_work(work); | 8519 | btrfs_wait_and_free_delalloc_work(work); |