aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiao Xie <miaox@cn.fujitsu.com>2013-01-22 10:49:33 +0000
committerJosef Bacik <jbacik@fusionio.com>2013-02-20 09:37:21 -0500
commit3edb2a68cb23cd6ca84022421eeae2604722cdc4 (patch)
treec6755d624d37cc02672e1aa47ab3d9c80d160576
parente6ec716f0ddbe51741ef261d0804f0c28038dda4 (diff)
downloadkernel_goldelico_gta04-3edb2a68cb23cd6ca84022421eeae2604722cdc4.zip
kernel_goldelico_gta04-3edb2a68cb23cd6ca84022421eeae2604722cdc4.tar.gz
kernel_goldelico_gta04-3edb2a68cb23cd6ca84022421eeae2604722cdc4.tar.bz2
Btrfs: check the return value of btrfs_start_delalloc_inodes()
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>
-rw-r--r--fs/btrfs/dev-replace.c6
-rw-r--r--fs/btrfs/transaction.c4
2 files changed, 8 insertions, 2 deletions
diff --git a/fs/btrfs/dev-replace.c b/fs/btrfs/dev-replace.c
index 66dbc8d..7ba7b39 100644
--- a/fs/btrfs/dev-replace.c
+++ b/fs/btrfs/dev-replace.c
@@ -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);
diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c
index 24fde97..42dac27 100644
--- a/fs/btrfs/transaction.c
+++ b/fs/btrfs/transaction.c
@@ -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);
}