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

Merge tag 'for-6.2-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux

Pull btrfs fixes from David Sterba:
"First batch of regression and regular fixes:

- regressions:
- fix error handling after conversion to qstr for paths
- fix raid56/scrub recovery caused by uninitialized variable
after conversion to error bitmaps
- restore qgroup backref lookup behaviour after recent
refactoring
- fix leak of device lists at module exit time

- fix resolving backrefs for inline extent followed by prealloc

- reset defrag ioctl buffer on memory allocation error"

* tag 'for-6.2-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux:
btrfs: fix fscrypt name leak after failure to join log transaction
btrfs: scrub: fix uninitialized return value in recover_scrub_rbio
btrfs: fix resolving backrefs for inline extent followed by prealloc
btrfs: fix trace event name typo for FLUSH_DELAYED_REFS
btrfs: restore BTRFS_SEQ_LAST when looking up qgroup backref lookup
btrfs: fix leak of fs devices after removing btrfs module
btrfs: fix an error handling path in btrfs_defrag_leaves()
btrfs: fix an error handling path in btrfs_rename()

+20 -7
+4
fs/btrfs/backref.c
··· 484 484 u64 wanted_disk_byte = ref->wanted_disk_byte; 485 485 u64 count = 0; 486 486 u64 data_offset; 487 + u8 type; 487 488 488 489 if (level != 0) { 489 490 eb = path->nodes[level]; ··· 539 538 continue; 540 539 } 541 540 fi = btrfs_item_ptr(eb, slot, struct btrfs_file_extent_item); 541 + type = btrfs_file_extent_type(eb, fi); 542 + if (type == BTRFS_FILE_EXTENT_INLINE) 543 + goto next; 542 544 disk_byte = btrfs_file_extent_disk_bytenr(eb, fi); 543 545 data_offset = btrfs_file_extent_offset(eb, fi); 544 546
+4 -2
fs/btrfs/defrag.c
··· 358 358 goto out; 359 359 360 360 path = btrfs_alloc_path(); 361 - if (!path) 362 - return -ENOMEM; 361 + if (!path) { 362 + ret = -ENOMEM; 363 + goto out; 364 + } 363 365 364 366 level = btrfs_header_level(root->node); 365 367
+4 -2
fs/btrfs/inode.c
··· 9377 9377 9378 9378 if (flags & RENAME_WHITEOUT) { 9379 9379 whiteout_args.inode = new_whiteout_inode(mnt_userns, old_dir); 9380 - if (!whiteout_args.inode) 9381 - return -ENOMEM; 9380 + if (!whiteout_args.inode) { 9381 + ret = -ENOMEM; 9382 + goto out_fscrypt_names; 9383 + } 9382 9384 ret = btrfs_new_inode_prepare(&whiteout_args, &trans_num_items); 9383 9385 if (ret) 9384 9386 goto out_whiteout_inode;
+1
fs/btrfs/qgroup.c
··· 2787 2787 * current root. It's safe inside commit_transaction(). 2788 2788 */ 2789 2789 ctx.trans = trans; 2790 + ctx.time_seq = BTRFS_SEQ_LAST; 2790 2791 ret = btrfs_find_all_roots(&ctx, false); 2791 2792 if (ret < 0) 2792 2793 goto cleanup;
+1 -1
fs/btrfs/raid56.c
··· 2646 2646 void **pointers = NULL; 2647 2647 void **unmap_array = NULL; 2648 2648 int sector_nr; 2649 - int ret; 2649 + int ret = 0; 2650 2650 2651 2651 /* 2652 2652 * @pointers array stores the pointer for each sector.
+1
fs/btrfs/super.c
··· 2514 2514 static void __exit exit_btrfs_fs(void) 2515 2515 { 2516 2516 btrfs_exit_btrfs_fs(); 2517 + btrfs_cleanup_fs_uuids(); 2517 2518 } 2518 2519 2519 2520 static int __init init_btrfs_fs(void)
+4 -1
fs/btrfs/tree-log.c
··· 7459 7459 * not fail, but if it does, it's not serious, just bail out and 7460 7460 * mark the log for a full commit. 7461 7461 */ 7462 - if (WARN_ON_ONCE(ret < 0)) 7462 + if (WARN_ON_ONCE(ret < 0)) { 7463 + fscrypt_free_filename(&fname); 7463 7464 goto out; 7465 + } 7466 + 7464 7467 log_pinned = true; 7465 7468 7466 7469 path = btrfs_alloc_path();
+1 -1
include/trace/events/btrfs.h
··· 98 98 EM( FLUSH_DELALLOC_WAIT, "FLUSH_DELALLOC_WAIT") \ 99 99 EM( FLUSH_DELALLOC_FULL, "FLUSH_DELALLOC_FULL") \ 100 100 EM( FLUSH_DELAYED_REFS_NR, "FLUSH_DELAYED_REFS_NR") \ 101 - EM( FLUSH_DELAYED_REFS, "FLUSH_ELAYED_REFS") \ 101 + EM( FLUSH_DELAYED_REFS, "FLUSH_DELAYED_REFS") \ 102 102 EM( ALLOC_CHUNK, "ALLOC_CHUNK") \ 103 103 EM( ALLOC_CHUNK_FORCE, "ALLOC_CHUNK_FORCE") \ 104 104 EM( RUN_DELAYED_IPUTS, "RUN_DELAYED_IPUTS") \