diff options
Diffstat (limited to 'fs/btrfs/free-space-cache.c')
| -rw-r--r-- | fs/btrfs/free-space-cache.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/fs/btrfs/free-space-cache.c b/fs/btrfs/free-space-cache.c index 81fa75a8e1f3..5e020d76fd07 100644 --- a/fs/btrfs/free-space-cache.c +++ b/fs/btrfs/free-space-cache.c | |||
| @@ -86,7 +86,7 @@ static struct inode *__lookup_free_space_inode(struct btrfs_root *root, | |||
| 86 | 86 | ||
| 87 | mapping_set_gfp_mask(inode->i_mapping, | 87 | mapping_set_gfp_mask(inode->i_mapping, |
| 88 | mapping_gfp_mask(inode->i_mapping) & | 88 | mapping_gfp_mask(inode->i_mapping) & |
| 89 | ~(GFP_NOFS & ~__GFP_HIGHMEM)); | 89 | ~(__GFP_FS | __GFP_HIGHMEM)); |
| 90 | 90 | ||
| 91 | return inode; | 91 | return inode; |
| 92 | } | 92 | } |
| @@ -1218,7 +1218,7 @@ out: | |||
| 1218 | * | 1218 | * |
| 1219 | * This function writes out a free space cache struct to disk for quick recovery | 1219 | * This function writes out a free space cache struct to disk for quick recovery |
| 1220 | * on mount. This will return 0 if it was successfull in writing the cache out, | 1220 | * on mount. This will return 0 if it was successfull in writing the cache out, |
| 1221 | * and -1 if it was not. | 1221 | * or an errno if it was not. |
| 1222 | */ | 1222 | */ |
| 1223 | static int __btrfs_write_out_cache(struct btrfs_root *root, struct inode *inode, | 1223 | static int __btrfs_write_out_cache(struct btrfs_root *root, struct inode *inode, |
| 1224 | struct btrfs_free_space_ctl *ctl, | 1224 | struct btrfs_free_space_ctl *ctl, |
| @@ -1235,12 +1235,12 @@ static int __btrfs_write_out_cache(struct btrfs_root *root, struct inode *inode, | |||
| 1235 | int must_iput = 0; | 1235 | int must_iput = 0; |
| 1236 | 1236 | ||
| 1237 | if (!i_size_read(inode)) | 1237 | if (!i_size_read(inode)) |
| 1238 | return -1; | 1238 | return -EIO; |
| 1239 | 1239 | ||
| 1240 | WARN_ON(io_ctl->pages); | 1240 | WARN_ON(io_ctl->pages); |
| 1241 | ret = io_ctl_init(io_ctl, inode, root, 1); | 1241 | ret = io_ctl_init(io_ctl, inode, root, 1); |
| 1242 | if (ret) | 1242 | if (ret) |
| 1243 | return -1; | 1243 | return ret; |
| 1244 | 1244 | ||
| 1245 | if (block_group && (block_group->flags & BTRFS_BLOCK_GROUP_DATA)) { | 1245 | if (block_group && (block_group->flags & BTRFS_BLOCK_GROUP_DATA)) { |
| 1246 | down_write(&block_group->data_rwsem); | 1246 | down_write(&block_group->data_rwsem); |
| @@ -1258,7 +1258,9 @@ static int __btrfs_write_out_cache(struct btrfs_root *root, struct inode *inode, | |||
| 1258 | } | 1258 | } |
| 1259 | 1259 | ||
| 1260 | /* Lock all pages first so we can lock the extent safely. */ | 1260 | /* Lock all pages first so we can lock the extent safely. */ |
| 1261 | io_ctl_prepare_pages(io_ctl, inode, 0); | 1261 | ret = io_ctl_prepare_pages(io_ctl, inode, 0); |
| 1262 | if (ret) | ||
| 1263 | goto out; | ||
| 1262 | 1264 | ||
| 1263 | lock_extent_bits(&BTRFS_I(inode)->io_tree, 0, i_size_read(inode) - 1, | 1265 | lock_extent_bits(&BTRFS_I(inode)->io_tree, 0, i_size_read(inode) - 1, |
| 1264 | 0, &cached_state); | 1266 | 0, &cached_state); |
