Skip to content

Commit 69b41ac

Browse files
committed
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()
2 parents 0226635 + fee4c19 commit 69b41ac

File tree

8 files changed

+20
-7
lines changed

8 files changed

+20
-7
lines changed

fs/btrfs/backref.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -484,6 +484,7 @@ static int add_all_parents(struct btrfs_backref_walk_ctx *ctx,
484484
u64 wanted_disk_byte = ref->wanted_disk_byte;
485485
u64 count = 0;
486486
u64 data_offset;
487+
u8 type;
487488

488489
if (level != 0) {
489490
eb = path->nodes[level];
@@ -538,6 +539,9 @@ static int add_all_parents(struct btrfs_backref_walk_ctx *ctx,
538539
continue;
539540
}
540541
fi = btrfs_item_ptr(eb, slot, struct btrfs_file_extent_item);
542+
type = btrfs_file_extent_type(eb, fi);
543+
if (type == BTRFS_FILE_EXTENT_INLINE)
544+
goto next;
541545
disk_byte = btrfs_file_extent_disk_bytenr(eb, fi);
542546
data_offset = btrfs_file_extent_offset(eb, fi);
543547

fs/btrfs/defrag.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -358,8 +358,10 @@ int btrfs_defrag_leaves(struct btrfs_trans_handle *trans,
358358
goto out;
359359

360360
path = btrfs_alloc_path();
361-
if (!path)
362-
return -ENOMEM;
361+
if (!path) {
362+
ret = -ENOMEM;
363+
goto out;
364+
}
363365

364366
level = btrfs_header_level(root->node);
365367

fs/btrfs/inode.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9377,8 +9377,10 @@ static int btrfs_rename(struct user_namespace *mnt_userns,
93779377

93789378
if (flags & RENAME_WHITEOUT) {
93799379
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+
}
93829384
ret = btrfs_new_inode_prepare(&whiteout_args, &trans_num_items);
93839385
if (ret)
93849386
goto out_whiteout_inode;

fs/btrfs/qgroup.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2787,6 +2787,7 @@ int btrfs_qgroup_account_extents(struct btrfs_trans_handle *trans)
27872787
* current root. It's safe inside commit_transaction().
27882788
*/
27892789
ctx.trans = trans;
2790+
ctx.time_seq = BTRFS_SEQ_LAST;
27902791
ret = btrfs_find_all_roots(&ctx, false);
27912792
if (ret < 0)
27922793
goto cleanup;

fs/btrfs/raid56.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2646,7 +2646,7 @@ static int recover_scrub_rbio(struct btrfs_raid_bio *rbio)
26462646
void **pointers = NULL;
26472647
void **unmap_array = NULL;
26482648
int sector_nr;
2649-
int ret;
2649+
int ret = 0;
26502650

26512651
/*
26522652
* @pointers array stores the pointer for each sector.

fs/btrfs/super.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2514,6 +2514,7 @@ static __always_inline void btrfs_exit_btrfs_fs(void)
25142514
static void __exit exit_btrfs_fs(void)
25152515
{
25162516
btrfs_exit_btrfs_fs();
2517+
btrfs_cleanup_fs_uuids();
25172518
}
25182519

25192520
static int __init init_btrfs_fs(void)

fs/btrfs/tree-log.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7459,8 +7459,11 @@ void btrfs_log_new_name(struct btrfs_trans_handle *trans,
74597459
* not fail, but if it does, it's not serious, just bail out and
74607460
* mark the log for a full commit.
74617461
*/
7462-
if (WARN_ON_ONCE(ret < 0))
7462+
if (WARN_ON_ONCE(ret < 0)) {
7463+
fscrypt_free_filename(&fname);
74637464
goto out;
7465+
}
7466+
74647467
log_pinned = true;
74657468

74667469
path = btrfs_alloc_path();

include/trace/events/btrfs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ struct raid56_bio_trace_info;
9898
EM( FLUSH_DELALLOC_WAIT, "FLUSH_DELALLOC_WAIT") \
9999
EM( FLUSH_DELALLOC_FULL, "FLUSH_DELALLOC_FULL") \
100100
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") \
102102
EM( ALLOC_CHUNK, "ALLOC_CHUNK") \
103103
EM( ALLOC_CHUNK_FORCE, "ALLOC_CHUNK_FORCE") \
104104
EM( RUN_DELAYED_IPUTS, "RUN_DELAYED_IPUTS") \

0 commit comments

Comments
 (0)