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

Pull btrfs fixes from David Sterba:
"A few more fixes:

- regression fix for a crash after failed snapshot creation

- one more lockep fix: use nofs allocation when allocating missing
device

- fix reloc tree leak on degraded mount

- make some extent buffer alignment checks less strict to mount
filesystems created by btrfs-convert"

* tag 'for-5.9-rc4-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux:
btrfs: fix NULL pointer dereference after failure to create snapshot
btrfs: free data reloc tree on failed mount
btrfs: require only sector size alignment for parent eb bytenr
btrfs: fix lockdep splat in add_missing_dev

+29 -15
+2
fs/btrfs/disk-io.c
··· 3418 3418 btrfs_put_block_group_cache(fs_info); 3419 3419 3420 3420 fail_tree_roots: 3421 + if (fs_info->data_reloc_root) 3422 + btrfs_drop_and_free_fs_root(fs_info, fs_info->data_reloc_root); 3421 3423 free_root_pointers(fs_info, true); 3422 3424 invalidate_inode_pages2(fs_info->btree_inode->i_mapping); 3423 3425
+9 -10
fs/btrfs/extent-tree.c
··· 400 400 if (type == BTRFS_SHARED_BLOCK_REF_KEY) { 401 401 ASSERT(eb->fs_info); 402 402 /* 403 - * Every shared one has parent tree 404 - * block, which must be aligned to 405 - * nodesize. 403 + * Every shared one has parent tree block, 404 + * which must be aligned to sector size. 406 405 */ 407 406 if (offset && 408 - IS_ALIGNED(offset, eb->fs_info->nodesize)) 407 + IS_ALIGNED(offset, eb->fs_info->sectorsize)) 409 408 return type; 410 409 } 411 410 } else if (is_data == BTRFS_REF_TYPE_DATA) { ··· 413 414 if (type == BTRFS_SHARED_DATA_REF_KEY) { 414 415 ASSERT(eb->fs_info); 415 416 /* 416 - * Every shared one has parent tree 417 - * block, which must be aligned to 418 - * nodesize. 417 + * Every shared one has parent tree block, 418 + * which must be aligned to sector size. 419 419 */ 420 420 if (offset && 421 - IS_ALIGNED(offset, eb->fs_info->nodesize)) 421 + IS_ALIGNED(offset, eb->fs_info->sectorsize)) 422 422 return type; 423 423 } 424 424 } else { ··· 427 429 } 428 430 429 431 btrfs_print_leaf((struct extent_buffer *)eb); 430 - btrfs_err(eb->fs_info, "eb %llu invalid extent inline ref type %d", 431 - eb->start, type); 432 + btrfs_err(eb->fs_info, 433 + "eb %llu iref 0x%lx invalid extent inline ref type %d", 434 + eb->start, (unsigned long)iref, type); 432 435 WARN_ON(1); 433 436 434 437 return BTRFS_REF_TYPE_INVALID;
+7 -5
fs/btrfs/print-tree.c
··· 95 95 * offset is supposed to be a tree block which 96 96 * must be aligned to nodesize. 97 97 */ 98 - if (!IS_ALIGNED(offset, eb->fs_info->nodesize)) 99 - pr_info("\t\t\t(parent %llu is NOT ALIGNED to nodesize %llu)\n", 100 - offset, (unsigned long long)eb->fs_info->nodesize); 98 + if (!IS_ALIGNED(offset, eb->fs_info->sectorsize)) 99 + pr_info( 100 + "\t\t\t(parent %llu not aligned to sectorsize %u)\n", 101 + offset, eb->fs_info->sectorsize); 101 102 break; 102 103 case BTRFS_EXTENT_DATA_REF_KEY: 103 104 dref = (struct btrfs_extent_data_ref *)(&iref->offset); ··· 113 112 * must be aligned to nodesize. 114 113 */ 115 114 if (!IS_ALIGNED(offset, eb->fs_info->nodesize)) 116 - pr_info("\t\t\t(parent %llu is NOT ALIGNED to nodesize %llu)\n", 117 - offset, (unsigned long long)eb->fs_info->nodesize); 115 + pr_info( 116 + "\t\t\t(parent %llu not aligned to sectorsize %u)\n", 117 + offset, eb->fs_info->sectorsize); 118 118 break; 119 119 default: 120 120 pr_cont("(extent %llu has INVALID ref type %d)\n",
+1
fs/btrfs/transaction.c
··· 1636 1636 pending->snap = btrfs_get_new_fs_root(fs_info, objectid, pending->anon_dev); 1637 1637 if (IS_ERR(pending->snap)) { 1638 1638 ret = PTR_ERR(pending->snap); 1639 + pending->snap = NULL; 1639 1640 btrfs_abort_transaction(trans, ret); 1640 1641 goto fail; 1641 1642 }
+10
fs/btrfs/volumes.c
··· 4 4 */ 5 5 6 6 #include <linux/sched.h> 7 + #include <linux/sched/mm.h> 7 8 #include <linux/bio.h> 8 9 #include <linux/slab.h> 9 10 #include <linux/blkdev.h> ··· 6485 6484 u64 devid, u8 *dev_uuid) 6486 6485 { 6487 6486 struct btrfs_device *device; 6487 + unsigned int nofs_flag; 6488 6488 6489 + /* 6490 + * We call this under the chunk_mutex, so we want to use NOFS for this 6491 + * allocation, however we don't want to change btrfs_alloc_device() to 6492 + * always do NOFS because we use it in a lot of other GFP_KERNEL safe 6493 + * places. 6494 + */ 6495 + nofs_flag = memalloc_nofs_save(); 6489 6496 device = btrfs_alloc_device(NULL, &devid, dev_uuid); 6497 + memalloc_nofs_restore(nofs_flag); 6490 6498 if (IS_ERR(device)) 6491 6499 return device; 6492 6500