]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
Btrfs: check the return value of btrfs_start_delalloc_inodes()
authorMiao Xie <miaox@cn.fujitsu.com>
Tue, 22 Jan 2013 10:49:33 +0000 (10:49 +0000)
committerJosef Bacik <jbacik@fusionio.com>
Wed, 20 Feb 2013 14:37:21 +0000 (09:37 -0500)
We forget to check the return value of btrfs_start_delalloc_inodes(), fix it.

Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
fs/btrfs/dev-replace.c
fs/btrfs/transaction.c

index 66dbc8dbddf7584a7c4034203c896cf37fcecb39..7ba7b3900cb8eb749b82241cc4533b4fc978ef8a 100644 (file)
@@ -465,7 +465,11 @@ static int btrfs_dev_replace_finishing(struct btrfs_fs_info *fs_info,
         * flush all outstanding I/O and inode extent mappings before the
         * copy operation is declared as being finished
         */
-       btrfs_start_delalloc_inodes(root, 0);
+       ret = btrfs_start_delalloc_inodes(root, 0);
+       if (ret) {
+               mutex_unlock(&dev_replace->lock_finishing_cancel_unmount);
+               return ret;
+       }
        btrfs_wait_ordered_extents(root, 0);
 
        trans = btrfs_start_transaction(root, 0);
index 24fde97cba81ddc04fd6551e2d50343aea1a436b..42dac27207ab7685997fa55cc800ec8f5213ea62 100644 (file)
@@ -1427,7 +1427,9 @@ static int btrfs_flush_all_pending_stuffs(struct btrfs_trans_handle *trans,
        }
 
        if (flush_on_commit || snap_pending) {
-               btrfs_start_delalloc_inodes(root, 1);
+               ret = btrfs_start_delalloc_inodes(root, 1);
+               if (ret)
+                       return ret;
                btrfs_wait_ordered_extents(root, 1);
        }