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

Pull btrfs fixes from David Sterba:
"Fixes for issues that have some user visibility and are simple enough
for this time of development cycle:

- a few fixes for rescue= mount option, adding more checks for
missing trees

- fix sleeping in atomic context on qgroup deletion

- fix subvolume deletion on mount

- fix build with M= syntax

- fix checksum mismatch error message for direct io"

* tag 'for-5.12-rc4-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux:
btrfs: fix check_data_csum() error message for direct I/O
btrfs: fix sleep while in non-sleep context during qgroup removal
btrfs: fix subvolume/snapshot deletion not triggered on mount
btrfs: fix build when using M=fs/btrfs
btrfs: do not initialize dev replace for bad dev root
btrfs: initialize device::fs_info always
btrfs: do not initialize dev stats if we have no dev_root
btrfs: zoned: remove outdated WARN_ON in direct IO

+48 -17
+6 -4
fs/btrfs/Makefile
··· 7 7 subdir-ccflags-y += -Wmissing-prototypes 8 8 subdir-ccflags-y += -Wold-style-definition 9 9 subdir-ccflags-y += -Wmissing-include-dirs 10 - subdir-ccflags-y += $(call cc-option, -Wunused-but-set-variable) 11 - subdir-ccflags-y += $(call cc-option, -Wunused-const-variable) 12 - subdir-ccflags-y += $(call cc-option, -Wpacked-not-aligned) 13 - subdir-ccflags-y += $(call cc-option, -Wstringop-truncation) 10 + condflags := \ 11 + $(call cc-option, -Wunused-but-set-variable) \ 12 + $(call cc-option, -Wunused-const-variable) \ 13 + $(call cc-option, -Wpacked-not-aligned) \ 14 + $(call cc-option, -Wstringop-truncation) 15 + subdir-ccflags-y += $(condflags) 14 16 # The following turn off the warnings enabled by -Wextra 15 17 subdir-ccflags-y += -Wno-missing-field-initializers 16 18 subdir-ccflags-y += -Wno-sign-compare
+3
fs/btrfs/dev-replace.c
··· 81 81 struct btrfs_dev_replace_item *ptr; 82 82 u64 src_devid; 83 83 84 + if (!dev_root) 85 + return 0; 86 + 84 87 path = btrfs_alloc_path(); 85 88 if (!path) { 86 89 ret = -ENOMEM;
+17 -2
fs/btrfs/disk-io.c
··· 2387 2387 } else { 2388 2388 set_bit(BTRFS_ROOT_TRACK_DIRTY, &root->state); 2389 2389 fs_info->dev_root = root; 2390 - btrfs_init_devices_late(fs_info); 2391 2390 } 2391 + /* Initialize fs_info for all devices in any case */ 2392 + btrfs_init_devices_late(fs_info); 2392 2393 2393 2394 /* If IGNOREDATACSUMS is set don't bother reading the csum root. */ 2394 2395 if (!btrfs_test_opt(fs_info, IGNOREDATACSUMS)) { ··· 3010 3009 } 3011 3010 } 3012 3011 3012 + /* 3013 + * btrfs_find_orphan_roots() is responsible for finding all the dead 3014 + * roots (with 0 refs), flag them with BTRFS_ROOT_DEAD_TREE and load 3015 + * them into the fs_info->fs_roots_radix tree. This must be done before 3016 + * calling btrfs_orphan_cleanup() on the tree root. If we don't do it 3017 + * first, then btrfs_orphan_cleanup() will delete a dead root's orphan 3018 + * item before the root's tree is deleted - this means that if we unmount 3019 + * or crash before the deletion completes, on the next mount we will not 3020 + * delete what remains of the tree because the orphan item does not 3021 + * exists anymore, which is what tells us we have a pending deletion. 3022 + */ 3023 + ret = btrfs_find_orphan_roots(fs_info); 3024 + if (ret) 3025 + goto out; 3026 + 3013 3027 ret = btrfs_cleanup_fs_roots(fs_info); 3014 3028 if (ret) 3015 3029 goto out; ··· 3084 3068 } 3085 3069 } 3086 3070 3087 - ret = btrfs_find_orphan_roots(fs_info); 3088 3071 out: 3089 3072 return ret; 3090 3073 }
+9 -9
fs/btrfs/inode.c
··· 3099 3099 * @bio_offset: offset to the beginning of the bio (in bytes) 3100 3100 * @page: page where is the data to be verified 3101 3101 * @pgoff: offset inside the page 3102 + * @start: logical offset in the file 3102 3103 * 3103 3104 * The length of such check is always one sector size. 3104 3105 */ 3105 3106 static int check_data_csum(struct inode *inode, struct btrfs_io_bio *io_bio, 3106 - u32 bio_offset, struct page *page, u32 pgoff) 3107 + u32 bio_offset, struct page *page, u32 pgoff, 3108 + u64 start) 3107 3109 { 3108 3110 struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb); 3109 3111 SHASH_DESC_ON_STACK(shash, fs_info->csum_shash); ··· 3132 3130 kunmap_atomic(kaddr); 3133 3131 return 0; 3134 3132 zeroit: 3135 - btrfs_print_data_csum_error(BTRFS_I(inode), page_offset(page) + pgoff, 3136 - csum, csum_expected, io_bio->mirror_num); 3133 + btrfs_print_data_csum_error(BTRFS_I(inode), start, csum, csum_expected, 3134 + io_bio->mirror_num); 3137 3135 if (io_bio->device) 3138 3136 btrfs_dev_stat_inc_and_print(io_bio->device, 3139 3137 BTRFS_DEV_STAT_CORRUPTION_ERRS); ··· 3186 3184 pg_off += sectorsize, bio_offset += sectorsize) { 3187 3185 int ret; 3188 3186 3189 - ret = check_data_csum(inode, io_bio, bio_offset, page, pg_off); 3187 + ret = check_data_csum(inode, io_bio, bio_offset, page, pg_off, 3188 + page_offset(page) + pg_off); 3190 3189 if (ret < 0) 3191 3190 return -EIO; 3192 3191 } ··· 7913 7910 ASSERT(pgoff < PAGE_SIZE); 7914 7911 if (uptodate && 7915 7912 (!csum || !check_data_csum(inode, io_bio, 7916 - bio_offset, bvec.bv_page, pgoff))) { 7913 + bio_offset, bvec.bv_page, 7914 + pgoff, start))) { 7917 7915 clean_io_failure(fs_info, failure_tree, io_tree, 7918 7916 start, bvec.bv_page, 7919 7917 btrfs_ino(BTRFS_I(inode)), ··· 8172 8168 bio->bi_private = dip; 8173 8169 bio->bi_end_io = btrfs_end_dio_bio; 8174 8170 btrfs_io_bio(bio)->logical = file_offset; 8175 - 8176 - WARN_ON_ONCE(write && btrfs_is_zoned(fs_info) && 8177 - fs_info->max_zone_append_size && 8178 - bio_op(bio) != REQ_OP_ZONE_APPEND); 8179 8171 8180 8172 if (bio_op(bio) == REQ_OP_ZONE_APPEND) { 8181 8173 status = extract_ordered_extent(BTRFS_I(inode), bio,
+10 -2
fs/btrfs/qgroup.c
··· 226 226 { 227 227 struct btrfs_qgroup_list *list; 228 228 229 - btrfs_sysfs_del_one_qgroup(fs_info, qgroup); 230 229 list_del(&qgroup->dirty); 231 230 while (!list_empty(&qgroup->groups)) { 232 231 list = list_first_entry(&qgroup->groups, ··· 242 243 list_del(&list->next_member); 243 244 kfree(list); 244 245 } 245 - kfree(qgroup); 246 246 } 247 247 248 248 /* must be called with qgroup_lock held */ ··· 567 569 qgroup = rb_entry(n, struct btrfs_qgroup, node); 568 570 rb_erase(n, &fs_info->qgroup_tree); 569 571 __del_qgroup_rb(fs_info, qgroup); 572 + btrfs_sysfs_del_one_qgroup(fs_info, qgroup); 573 + kfree(qgroup); 570 574 } 571 575 /* 572 576 * We call btrfs_free_qgroup_config() when unmounting ··· 1578 1578 spin_lock(&fs_info->qgroup_lock); 1579 1579 del_qgroup_rb(fs_info, qgroupid); 1580 1580 spin_unlock(&fs_info->qgroup_lock); 1581 + 1582 + /* 1583 + * Remove the qgroup from sysfs now without holding the qgroup_lock 1584 + * spinlock, since the sysfs_remove_group() function needs to take 1585 + * the mutex kernfs_mutex through kernfs_remove_by_name_ns(). 1586 + */ 1587 + btrfs_sysfs_del_one_qgroup(fs_info, qgroup); 1588 + kfree(qgroup); 1581 1589 out: 1582 1590 mutex_unlock(&fs_info->qgroup_ioctl_lock); 1583 1591 return ret;
+3
fs/btrfs/volumes.c
··· 7448 7448 int item_size; 7449 7449 int i, ret, slot; 7450 7450 7451 + if (!device->fs_info->dev_root) 7452 + return 0; 7453 + 7451 7454 key.objectid = BTRFS_DEV_STATS_OBJECTID; 7452 7455 key.type = BTRFS_PERSISTENT_ITEM_KEY; 7453 7456 key.offset = device->devid;