+7
-3
fs/btrfs/free-space-cache.c
+7
-3
fs/btrfs/free-space-cache.c
···
1149
1149
if (!inode)
1150
1150
return 0;
1151
1151
1152
-
root = root->fs_info->tree_root;
1152
+
if (block_group)
1153
+
root = root->fs_info->tree_root;
1153
1154
1154
1155
/* Flush the dirty pages in the cache file. */
1155
1156
ret = flush_dirty_cache(inode);
···
3464
3463
if (!btrfs_test_opt(root, INODE_MAP_CACHE))
3465
3464
return 0;
3466
3465
3466
+
memset(&io_ctl, 0, sizeof(io_ctl));
3467
3467
ret = __btrfs_write_out_cache(root, inode, ctl, NULL, &io_ctl,
3468
-
trans, path, 0) ||
3469
-
btrfs_wait_cache_io(root, trans, NULL, &io_ctl, path, 0);
3468
+
trans, path, 0);
3469
+
if (!ret)
3470
+
ret = btrfs_wait_cache_io(root, trans, NULL, &io_ctl, path, 0);
3471
+
3470
3472
if (ret) {
3471
3473
btrfs_delalloc_release_metadata(inode, inode->i_size);
3472
3474
#ifdef DEBUG