summaryrefslogtreecommitdiff
path: root/disk-io.c
diff options
context:
space:
mode:
authorOmar Sandoval <osandov@fb.com>2017-03-03 09:02:14 -0800
committerDavid Sterba <dsterba@suse.com>2017-03-08 13:36:49 +0100
commit7fbb89d167ec2d8f3e7c0b46285778c1c481a742 (patch)
tree48ac1371e3860b2c70bfd09ace167f3e61030672 /disk-io.c
parent839de9c033f3f6ecda2f61fcbcd1dfafc0e68125 (diff)
btrfs-progs: report I/O errors when closing the filesystem
If the final fsync() on the Btrfs device fails, we just swallow the error and don't alert the user in any way. This was uncovered by xfstest generic/405, which checks that mkfs fails when it encounters EIO. Signed-off-by: Omar Sandoval <osandov@fb.com> Reviewed-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'disk-io.c')
-rw-r--r--disk-io.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/disk-io.c b/disk-io.c
index be6e28a4..985c4a9f 100644
--- a/disk-io.c
+++ b/disk-io.c
@@ -1815,10 +1815,10 @@ int close_ctree_fs_info(struct btrfs_fs_info *fs_info)
free_fs_roots_tree(&fs_info->fs_root_tree);
btrfs_release_all_roots(fs_info);
- btrfs_close_devices(fs_info->fs_devices);
+ ret = btrfs_close_devices(fs_info->fs_devices);
btrfs_cleanup_all_caches(fs_info);
btrfs_free_fs_info(fs_info);
- return 0;
+ return ret;
}
int clean_tree_block(struct btrfs_trans_handle *trans, struct btrfs_root *root,