Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs:
Btrfs: fix meta data raid-repair merge problem
Btrfs: skip allocation attempt from empty cluster
Btrfs: skip block groups without enough space for a cluster
Btrfs: start search for new cluster at the beginning
Btrfs: reset cluster's max_size when creating bitmap
Btrfs: initialize new bitmaps' list
Btrfs: fix oops when calling statfs on readonly device
Btrfs: Don't error on resizing FS to same size
Btrfs: fix deadlock on metadata reservation when evicting a inode
Fix URL of btrfs-progs git repository in docs
btrfs scrub: handle -ENOMEM from init_ipath()

+60 -25
+2 -2
Documentation/filesystems/btrfs.txt
··· 63 63 Userspace tools for creating and manipulating Btrfs file systems are 64 64 available from the git repository at the following location: 65 65 66 - http://git.kernel.org/?p=linux/kernel/git/mason/btrfs-progs-unstable.git 67 - git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-progs-unstable.git 66 + http://git.kernel.org/?p=linux/kernel/git/mason/btrfs-progs.git 67 + git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-progs.git 68 68 69 69 These include the following tools: 70 70
+3
fs/btrfs/ctree.h
··· 2369 2369 int btrfs_block_rsv_refill(struct btrfs_root *root, 2370 2370 struct btrfs_block_rsv *block_rsv, 2371 2371 u64 min_reserved); 2372 + int btrfs_block_rsv_refill_noflush(struct btrfs_root *root, 2373 + struct btrfs_block_rsv *block_rsv, 2374 + u64 min_reserved); 2372 2375 int btrfs_block_rsv_migrate(struct btrfs_block_rsv *src_rsv, 2373 2376 struct btrfs_block_rsv *dst_rsv, 2374 2377 u64 num_bytes);
+23 -11
fs/btrfs/extent-tree.c
··· 3888 3888 return ret; 3889 3889 } 3890 3890 3891 - int btrfs_block_rsv_refill(struct btrfs_root *root, 3892 - struct btrfs_block_rsv *block_rsv, 3893 - u64 min_reserved) 3891 + static inline int __btrfs_block_rsv_refill(struct btrfs_root *root, 3892 + struct btrfs_block_rsv *block_rsv, 3893 + u64 min_reserved, int flush) 3894 3894 { 3895 3895 u64 num_bytes = 0; 3896 3896 int ret = -ENOSPC; ··· 3909 3909 if (!ret) 3910 3910 return 0; 3911 3911 3912 - ret = reserve_metadata_bytes(root, block_rsv, num_bytes, 1); 3912 + ret = reserve_metadata_bytes(root, block_rsv, num_bytes, flush); 3913 3913 if (!ret) { 3914 3914 block_rsv_add_bytes(block_rsv, num_bytes, 0); 3915 3915 return 0; 3916 3916 } 3917 3917 3918 3918 return ret; 3919 + } 3920 + 3921 + int btrfs_block_rsv_refill(struct btrfs_root *root, 3922 + struct btrfs_block_rsv *block_rsv, 3923 + u64 min_reserved) 3924 + { 3925 + return __btrfs_block_rsv_refill(root, block_rsv, min_reserved, 1); 3926 + } 3927 + 3928 + int btrfs_block_rsv_refill_noflush(struct btrfs_root *root, 3929 + struct btrfs_block_rsv *block_rsv, 3930 + u64 min_reserved) 3931 + { 3932 + return __btrfs_block_rsv_refill(root, block_rsv, min_reserved, 0); 3919 3933 } 3920 3934 3921 3935 int btrfs_block_rsv_migrate(struct btrfs_block_rsv *src_rsv, ··· 5279 5265 spin_lock(&block_group->free_space_ctl->tree_lock); 5280 5266 if (cached && 5281 5267 block_group->free_space_ctl->free_space < 5282 - num_bytes + empty_size) { 5268 + num_bytes + empty_cluster + empty_size) { 5283 5269 spin_unlock(&block_group->free_space_ctl->tree_lock); 5284 5270 goto loop; 5285 5271 } ··· 5300 5286 * people trying to start a new cluster 5301 5287 */ 5302 5288 spin_lock(&last_ptr->refill_lock); 5303 - if (last_ptr->block_group && 5304 - (last_ptr->block_group->ro || 5305 - !block_group_bits(last_ptr->block_group, data))) { 5306 - offset = 0; 5289 + if (!last_ptr->block_group || 5290 + last_ptr->block_group->ro || 5291 + !block_group_bits(last_ptr->block_group, data)) 5307 5292 goto refill_cluster; 5308 - } 5309 5293 5310 5294 offset = btrfs_alloc_from_cluster(block_group, last_ptr, 5311 5295 num_bytes, search_start); ··· 5354 5342 /* allocate a cluster in this block group */ 5355 5343 ret = btrfs_find_space_cluster(trans, root, 5356 5344 block_group, last_ptr, 5357 - offset, num_bytes, 5345 + search_start, num_bytes, 5358 5346 empty_cluster + empty_size); 5359 5347 if (ret == 0) { 5360 5348 /*
+20 -7
fs/btrfs/extent_io.c
··· 2287 2287 if (!uptodate) { 2288 2288 int failed_mirror; 2289 2289 failed_mirror = (int)(unsigned long)bio->bi_bdev; 2290 - if (tree->ops && tree->ops->readpage_io_failed_hook) 2291 - ret = tree->ops->readpage_io_failed_hook( 2292 - bio, page, start, end, 2293 - failed_mirror, state); 2294 - else 2295 - ret = bio_readpage_error(bio, page, start, end, 2296 - failed_mirror, NULL); 2290 + /* 2291 + * The generic bio_readpage_error handles errors the 2292 + * following way: If possible, new read requests are 2293 + * created and submitted and will end up in 2294 + * end_bio_extent_readpage as well (if we're lucky, not 2295 + * in the !uptodate case). In that case it returns 0 and 2296 + * we just go on with the next page in our bio. If it 2297 + * can't handle the error it will return -EIO and we 2298 + * remain responsible for that page. 2299 + */ 2300 + ret = bio_readpage_error(bio, page, start, end, 2301 + failed_mirror, NULL); 2297 2302 if (ret == 0) { 2303 + error_handled: 2298 2304 uptodate = 2299 2305 test_bit(BIO_UPTODATE, &bio->bi_flags); 2300 2306 if (err) 2301 2307 uptodate = 0; 2302 2308 uncache_state(&cached); 2303 2309 continue; 2310 + } 2311 + if (tree->ops && tree->ops->readpage_io_failed_hook) { 2312 + ret = tree->ops->readpage_io_failed_hook( 2313 + bio, page, start, end, 2314 + failed_mirror, state); 2315 + if (ret == 0) 2316 + goto error_handled; 2304 2317 } 2305 2318 } 2306 2319
+2
fs/btrfs/free-space-cache.c
··· 1470 1470 { 1471 1471 info->offset = offset_to_bitmap(ctl, offset); 1472 1472 info->bytes = 0; 1473 + INIT_LIST_HEAD(&info->list); 1473 1474 link_free_space(ctl, info); 1474 1475 ctl->total_bitmaps++; 1475 1476 ··· 2320 2319 2321 2320 if (!found) { 2322 2321 start = i; 2322 + cluster->max_size = 0; 2323 2323 found = true; 2324 2324 } 2325 2325
+1 -1
fs/btrfs/inode.c
··· 3490 3490 * doing the truncate. 3491 3491 */ 3492 3492 while (1) { 3493 - ret = btrfs_block_rsv_refill(root, rsv, min_size); 3493 + ret = btrfs_block_rsv_refill_noflush(root, rsv, min_size); 3494 3494 3495 3495 /* 3496 3496 * Try and steal from the global reserve since we will
+1 -1
fs/btrfs/ioctl.c
··· 1278 1278 } 1279 1279 ret = btrfs_grow_device(trans, device, new_size); 1280 1280 btrfs_commit_transaction(trans, root); 1281 - } else { 1281 + } else if (new_size < old_size) { 1282 1282 ret = btrfs_shrink_device(device, new_size); 1283 1283 } 1284 1284
+5
fs/btrfs/scrub.c
··· 256 256 btrfs_release_path(swarn->path); 257 257 258 258 ipath = init_ipath(4096, local_root, swarn->path); 259 + if (IS_ERR(ipath)) { 260 + ret = PTR_ERR(ipath); 261 + ipath = NULL; 262 + goto err; 263 + } 259 264 ret = paths_from_inode(inum, ipath); 260 265 261 266 if (ret < 0)
+3 -3
fs/btrfs/super.c
··· 1057 1057 int i = 0, nr_devices; 1058 1058 int ret; 1059 1059 1060 - nr_devices = fs_info->fs_devices->rw_devices; 1060 + nr_devices = fs_info->fs_devices->open_devices; 1061 1061 BUG_ON(!nr_devices); 1062 1062 1063 1063 devices_info = kmalloc(sizeof(*devices_info) * nr_devices, ··· 1079 1079 else 1080 1080 min_stripe_size = BTRFS_STRIPE_LEN; 1081 1081 1082 - list_for_each_entry(device, &fs_devices->alloc_list, dev_alloc_list) { 1083 - if (!device->in_fs_metadata) 1082 + list_for_each_entry(device, &fs_devices->devices, dev_list) { 1083 + if (!device->in_fs_metadata || !device->bdev) 1084 1084 continue; 1085 1085 1086 1086 avail_space = device->total_bytes - device->bytes_used;