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>
         * 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);
 
        }
 
        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);
        }