Commit 69b41ac8 authored by Linus Torvalds's avatar Linus Torvalds

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()
parents 0226635c fee4c199
...@@ -484,6 +484,7 @@ static int add_all_parents(struct btrfs_backref_walk_ctx *ctx, ...@@ -484,6 +484,7 @@ static int add_all_parents(struct btrfs_backref_walk_ctx *ctx,
u64 wanted_disk_byte = ref->wanted_disk_byte; u64 wanted_disk_byte = ref->wanted_disk_byte;
u64 count = 0; u64 count = 0;
u64 data_offset; u64 data_offset;
u8 type;
if (level != 0) { if (level != 0) {
eb = path->nodes[level]; eb = path->nodes[level];
...@@ -538,6 +539,9 @@ static int add_all_parents(struct btrfs_backref_walk_ctx *ctx, ...@@ -538,6 +539,9 @@ static int add_all_parents(struct btrfs_backref_walk_ctx *ctx,
continue; continue;
} }
fi = btrfs_item_ptr(eb, slot, struct btrfs_file_extent_item); fi = btrfs_item_ptr(eb, slot, struct btrfs_file_extent_item);
type = btrfs_file_extent_type(eb, fi);
if (type == BTRFS_FILE_EXTENT_INLINE)
goto next;
disk_byte = btrfs_file_extent_disk_bytenr(eb, fi); disk_byte = btrfs_file_extent_disk_bytenr(eb, fi);
data_offset = btrfs_file_extent_offset(eb, fi); data_offset = btrfs_file_extent_offset(eb, fi);
......
...@@ -358,8 +358,10 @@ int btrfs_defrag_leaves(struct btrfs_trans_handle *trans, ...@@ -358,8 +358,10 @@ int btrfs_defrag_leaves(struct btrfs_trans_handle *trans,
goto out; goto out;
path = btrfs_alloc_path(); path = btrfs_alloc_path();
if (!path) if (!path) {
return -ENOMEM; ret = -ENOMEM;
goto out;
}
level = btrfs_header_level(root->node); level = btrfs_header_level(root->node);
......
...@@ -9377,8 +9377,10 @@ static int btrfs_rename(struct user_namespace *mnt_userns, ...@@ -9377,8 +9377,10 @@ static int btrfs_rename(struct user_namespace *mnt_userns,
if (flags & RENAME_WHITEOUT) { if (flags & RENAME_WHITEOUT) {
whiteout_args.inode = new_whiteout_inode(mnt_userns, old_dir); whiteout_args.inode = new_whiteout_inode(mnt_userns, old_dir);
if (!whiteout_args.inode) if (!whiteout_args.inode) {
return -ENOMEM; ret = -ENOMEM;
goto out_fscrypt_names;
}
ret = btrfs_new_inode_prepare(&whiteout_args, &trans_num_items); ret = btrfs_new_inode_prepare(&whiteout_args, &trans_num_items);
if (ret) if (ret)
goto out_whiteout_inode; goto out_whiteout_inode;
......
...@@ -2787,6 +2787,7 @@ int btrfs_qgroup_account_extents(struct btrfs_trans_handle *trans) ...@@ -2787,6 +2787,7 @@ int btrfs_qgroup_account_extents(struct btrfs_trans_handle *trans)
* current root. It's safe inside commit_transaction(). * current root. It's safe inside commit_transaction().
*/ */
ctx.trans = trans; ctx.trans = trans;
ctx.time_seq = BTRFS_SEQ_LAST;
ret = btrfs_find_all_roots(&ctx, false); ret = btrfs_find_all_roots(&ctx, false);
if (ret < 0) if (ret < 0)
goto cleanup; goto cleanup;
......
...@@ -2646,7 +2646,7 @@ static int recover_scrub_rbio(struct btrfs_raid_bio *rbio) ...@@ -2646,7 +2646,7 @@ static int recover_scrub_rbio(struct btrfs_raid_bio *rbio)
void **pointers = NULL; void **pointers = NULL;
void **unmap_array = NULL; void **unmap_array = NULL;
int sector_nr; int sector_nr;
int ret; int ret = 0;
/* /*
* @pointers array stores the pointer for each sector. * @pointers array stores the pointer for each sector.
......
...@@ -2514,6 +2514,7 @@ static __always_inline void btrfs_exit_btrfs_fs(void) ...@@ -2514,6 +2514,7 @@ static __always_inline void btrfs_exit_btrfs_fs(void)
static void __exit exit_btrfs_fs(void) static void __exit exit_btrfs_fs(void)
{ {
btrfs_exit_btrfs_fs(); btrfs_exit_btrfs_fs();
btrfs_cleanup_fs_uuids();
} }
static int __init init_btrfs_fs(void) static int __init init_btrfs_fs(void)
......
...@@ -7459,8 +7459,11 @@ void btrfs_log_new_name(struct btrfs_trans_handle *trans, ...@@ -7459,8 +7459,11 @@ void btrfs_log_new_name(struct btrfs_trans_handle *trans,
* not fail, but if it does, it's not serious, just bail out and * not fail, but if it does, it's not serious, just bail out and
* mark the log for a full commit. * mark the log for a full commit.
*/ */
if (WARN_ON_ONCE(ret < 0)) if (WARN_ON_ONCE(ret < 0)) {
fscrypt_free_filename(&fname);
goto out; goto out;
}
log_pinned = true; log_pinned = true;
path = btrfs_alloc_path(); path = btrfs_alloc_path();
......
...@@ -98,7 +98,7 @@ struct raid56_bio_trace_info; ...@@ -98,7 +98,7 @@ struct raid56_bio_trace_info;
EM( FLUSH_DELALLOC_WAIT, "FLUSH_DELALLOC_WAIT") \ EM( FLUSH_DELALLOC_WAIT, "FLUSH_DELALLOC_WAIT") \
EM( FLUSH_DELALLOC_FULL, "FLUSH_DELALLOC_FULL") \ EM( FLUSH_DELALLOC_FULL, "FLUSH_DELALLOC_FULL") \
EM( FLUSH_DELAYED_REFS_NR, "FLUSH_DELAYED_REFS_NR") \ EM( FLUSH_DELAYED_REFS_NR, "FLUSH_DELAYED_REFS_NR") \
EM( FLUSH_DELAYED_REFS, "FLUSH_ELAYED_REFS") \ EM( FLUSH_DELAYED_REFS, "FLUSH_DELAYED_REFS") \
EM( ALLOC_CHUNK, "ALLOC_CHUNK") \ EM( ALLOC_CHUNK, "ALLOC_CHUNK") \
EM( ALLOC_CHUNK_FORCE, "ALLOC_CHUNK_FORCE") \ EM( ALLOC_CHUNK_FORCE, "ALLOC_CHUNK_FORCE") \
EM( RUN_DELAYED_IPUTS, "RUN_DELAYED_IPUTS") \ EM( RUN_DELAYED_IPUTS, "RUN_DELAYED_IPUTS") \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment