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 tag 'for-4.15-rc3-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux

Pull btrfs fixes from David Sterba:
"This contains a few fixes (error handling, quota leak, FUA vs
nobarrier mount option).

There's one one worth mentioning separately - an off-by-one fix that
leads to overwriting first byte of an adjacent page with 0, out of
bounds of the memory allocated by an ioctl. This is under a privileged
part of the ioctl, can be triggerd in some subvolume layouts"

* tag 'for-4.15-rc3-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux:
btrfs: Fix possible off-by-one in btrfs_search_path_in_tree
Btrfs: disable FUA if mounted with nobarrier
btrfs: fix missing error return in btrfs_drop_snapshot
btrfs: handle errors while updating refcounts in update_ref_for_cow
btrfs: Fix quota reservation leak on preallocated files

+21 -14
+12 -6
fs/btrfs/ctree.c
··· 1032 1032 root->root_key.objectid == BTRFS_TREE_RELOC_OBJECTID) && 1033 1033 !(flags & BTRFS_BLOCK_FLAG_FULL_BACKREF)) { 1034 1034 ret = btrfs_inc_ref(trans, root, buf, 1); 1035 - BUG_ON(ret); /* -ENOMEM */ 1035 + if (ret) 1036 + return ret; 1036 1037 1037 1038 if (root->root_key.objectid == 1038 1039 BTRFS_TREE_RELOC_OBJECTID) { 1039 1040 ret = btrfs_dec_ref(trans, root, buf, 0); 1040 - BUG_ON(ret); /* -ENOMEM */ 1041 + if (ret) 1042 + return ret; 1041 1043 ret = btrfs_inc_ref(trans, root, cow, 1); 1042 - BUG_ON(ret); /* -ENOMEM */ 1044 + if (ret) 1045 + return ret; 1043 1046 } 1044 1047 new_flags |= BTRFS_BLOCK_FLAG_FULL_BACKREF; 1045 1048 } else { ··· 1052 1049 ret = btrfs_inc_ref(trans, root, cow, 1); 1053 1050 else 1054 1051 ret = btrfs_inc_ref(trans, root, cow, 0); 1055 - BUG_ON(ret); /* -ENOMEM */ 1052 + if (ret) 1053 + return ret; 1056 1054 } 1057 1055 if (new_flags != 0) { 1058 1056 int level = btrfs_header_level(buf); ··· 1072 1068 ret = btrfs_inc_ref(trans, root, cow, 1); 1073 1069 else 1074 1070 ret = btrfs_inc_ref(trans, root, cow, 0); 1075 - BUG_ON(ret); /* -ENOMEM */ 1071 + if (ret) 1072 + return ret; 1076 1073 ret = btrfs_dec_ref(trans, root, buf, 1); 1077 - BUG_ON(ret); /* -ENOMEM */ 1074 + if (ret) 1075 + return ret; 1078 1076 } 1079 1077 clean_tree_block(fs_info, buf); 1080 1078 *last_ref = 1;
+5 -7
fs/btrfs/disk-io.c
··· 3231 3231 int errors = 0; 3232 3232 u32 crc; 3233 3233 u64 bytenr; 3234 + int op_flags; 3234 3235 3235 3236 if (max_mirrors == 0) 3236 3237 max_mirrors = BTRFS_SUPER_MIRROR_MAX; ··· 3274 3273 * we fua the first super. The others we allow 3275 3274 * to go down lazy. 3276 3275 */ 3277 - if (i == 0) { 3278 - ret = btrfsic_submit_bh(REQ_OP_WRITE, 3279 - REQ_SYNC | REQ_FUA | REQ_META | REQ_PRIO, bh); 3280 - } else { 3281 - ret = btrfsic_submit_bh(REQ_OP_WRITE, 3282 - REQ_SYNC | REQ_META | REQ_PRIO, bh); 3283 - } 3276 + op_flags = REQ_SYNC | REQ_META | REQ_PRIO; 3277 + if (i == 0 && !btrfs_test_opt(device->fs_info, NOBARRIER)) 3278 + op_flags |= REQ_FUA; 3279 + ret = btrfsic_submit_bh(REQ_OP_WRITE, op_flags, bh); 3284 3280 if (ret) 3285 3281 errors++; 3286 3282 }
+1
fs/btrfs/extent-tree.c
··· 9206 9206 ret = btrfs_del_root(trans, fs_info, &root->root_key); 9207 9207 if (ret) { 9208 9208 btrfs_abort_transaction(trans, ret); 9209 + err = ret; 9209 9210 goto out_end_trans; 9210 9211 } 9211 9212
+2
fs/btrfs/inode.c
··· 3005 3005 compress_type = ordered_extent->compress_type; 3006 3006 if (test_bit(BTRFS_ORDERED_PREALLOC, &ordered_extent->flags)) { 3007 3007 BUG_ON(compress_type); 3008 + btrfs_qgroup_free_data(inode, NULL, ordered_extent->file_offset, 3009 + ordered_extent->len); 3008 3010 ret = btrfs_mark_extent_written(trans, BTRFS_I(inode), 3009 3011 ordered_extent->file_offset, 3010 3012 ordered_extent->file_offset +
+1 -1
fs/btrfs/ioctl.c
··· 2206 2206 if (!path) 2207 2207 return -ENOMEM; 2208 2208 2209 - ptr = &name[BTRFS_INO_LOOKUP_PATH_MAX]; 2209 + ptr = &name[BTRFS_INO_LOOKUP_PATH_MAX - 1]; 2210 2210 2211 2211 key.objectid = tree_id; 2212 2212 key.type = BTRFS_ROOT_ITEM_KEY;