summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/inode.c
diff options
context:
space:
mode:
authorWang Shilong <wangsl.fnst@cn.fujitsu.com>2014-04-02 13:53:32 +0200
committerChris Mason <clm@fb.com>2014-04-07 18:08:50 +0200
commita1ecaabbf90cf4e93eb2b50aef3d07ab630c6fb1 (patch)
treebe79e536c83d72f455c25971f20cf99c511d59ae /fs/btrfs/inode.c
parentBtrfs: scrub raid56 stripes in the right way (diff)
downloadlinux-a1ecaabbf90cf4e93eb2b50aef3d07ab630c6fb1.tar.xz
linux-a1ecaabbf90cf4e93eb2b50aef3d07ab630c6fb1.zip
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/btrfs/inode.c')
-rw-r--r--fs/btrfs/inode.c5
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,
else
iput(inode);
ret = -ENOMEM;
- break;
+ goto out;
}
list_add_tail(&work->list, &works);
btrfs_queue_work(root->fs_info->flush_workers,
&work->work);
ret++;
if (nr != -1 && ret >= nr)
- break;
+ goto out;
cond_resched();
spin_lock(&root->delalloc_lock);
}
spin_unlock(&root->delalloc_lock);
+out:
list_for_each_entry_safe(work, next, &works, list) {
list_del_init(&work->list);
btrfs_wait_and_free_delalloc_work(work);