linux/fs/btrfs
Jingkai Tan 2970525f78 btrfs: handle discard errors in in btrfs_finish_extent_commit()
Coverity (ID: 1226842) reported that the return value of
btrfs_discard_extent() is assigned to ret but is immediately
overwritten by unpin_extent_range() without being checked.

Use the same error handling that is done later in the same function.

Signed-off-by: Jingkai Tan <contact@jingk.ai>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2026-02-26 15:03:26 +01:00
..
tests btrfs: tests: add cleanup functions for test specific functions 2026-02-03 07:59:05 +01:00
accessors.c btrfs: fix typos in comments and strings 2025-09-23 08:49:16 +02:00
accessors.h btrfs: allow mounting filesystems with remap-tree incompat flag 2026-02-03 07:54:35 +01:00
acl.c btrfs: apply the AUTO_K(V)FREE macros throughout the code 2025-11-24 22:34:51 +01:00
acl.h btrfs: update include and forward declarations in headers 2025-03-18 20:35:43 +01:00
async-thread.c btrfs: use list_first_entry() everywhere 2025-05-15 14:30:47 +02:00
async-thread.h
backref.c btrfs: remove unreachable return after btrfs_backref_panic() in btrfs_backref_finish_upper_links() 2026-02-03 07:49:12 +01:00
backref.h btrfs: declare free_ipath() via DEFINE_FREE() 2025-11-24 22:34:51 +01:00
bio.c btrfs: do not ASSERT() when the fs flips RO inside btrfs_repair_io_failure() 2026-02-18 15:25:53 +01:00
bio.h btrfs: move existing remaps before relocating block group 2026-02-03 07:54:35 +01:00
block-group.c btrfs: reset block group size class when it becomes empty 2026-02-18 15:25:53 +01:00
block-group.h btrfs: populate fully_remapped_bgs_list on mount 2026-02-03 07:54:36 +01:00
block-rsv.c btrfs: use the correct type to initialize block reserve for delayed refs 2026-02-18 15:25:53 +01:00
block-rsv.h btrfs: add METADATA_REMAP chunk type 2026-02-03 07:54:27 +01:00
btrfs_inode.h btrfs: make read verification handle bs > ps cases without large folios 2025-11-24 22:42:24 +01:00
compression.c btrfs: get rid of compressed_bio::compressed_folios[] 2026-02-03 07:59:07 +01:00
compression.h btrfs: get rid of compressed_bio::compressed_folios[] 2026-02-03 07:59:07 +01:00
ctree.c btrfs: merge setting ret and return ret 2026-02-03 06:38:33 +01:00
ctree.h btrfs: introduce BTRFS_PATH_AUTO_RELEASE() helper 2026-02-03 06:38:32 +01:00
defrag.c btrfs: use the btrfs_extent_map_end() helper everywhere 2026-02-03 07:54:36 +01:00
defrag.h btrfs: pass struct btrfs_inode to btrfs_defrag_file() 2025-03-18 20:35:43 +01:00
delalloc-space.c btrfs: remove fs_info argument from btrfs_reserve_metadata_bytes() 2025-11-24 21:59:11 +01:00
delalloc-space.h btrfs: pass struct btrfs_inode to btrfs_free_reserved_data_space_noquota() 2025-05-15 14:30:52 +02:00
delayed-inode.c btrfs: pass btrfs_fs_info to btrfs_first_delayed_node() 2026-02-03 07:56:20 +01:00
delayed-inode.h btrfs: embed delayed root to struct btrfs_fs_info 2026-02-03 07:56:20 +01:00
delayed-ref.c btrfs: remove fs_info argument from btrfs_reserve_metadata_bytes() 2025-11-24 21:59:11 +01:00
delayed-ref.h btrfs: move ref-verify under CONFIG_BTRFS_DEBUG 2025-09-22 10:54:32 +02:00
dev-replace.c btrfs: use bool type for btrfs_path members used as booleans 2025-11-24 22:42:25 +01:00
dev-replace.h btrfs: trivial conversion to return bool instead of int 2025-05-15 14:30:49 +02:00
dir-item.c btrfs: remaining BTRFS_PATH_AUTO_FREE conversions 2025-11-25 01:53:33 +01:00
dir-item.h btrfs: rename inode number parameter passed to btrfs_check_dir_item_collision() 2025-07-22 00:05:00 +02:00
direct-io.c btrfs: fallback to buffered IO if the data profile has duplication 2026-02-03 07:56:19 +01:00
direct-io.h btrfs: update include and forward declarations in headers 2025-03-18 20:35:43 +01:00
discard.c btrfs: handle discarding fully-remapped block groups 2026-02-03 07:54:36 +01:00
discard.h btrfs: update include and forward declarations in headers 2025-03-18 20:35:43 +01:00
disk-io.c btrfs: change unaligned root messages to error level in btrfs_validate_super() 2026-02-18 15:25:53 +01:00
disk-io.h btrfs: headers cleanup to remove unnecessary local includes 2025-11-24 22:34:52 +01:00
export.c btrfs: avoid potential out-of-bounds in btrfs_encode_fh() 2025-09-26 08:48:30 +02:00
export.h
extent-io-tree.c btrfs: merge setting ret and return ret 2026-02-03 06:38:33 +01:00
extent-io-tree.h btrfs: convert several int parameters to bool 2025-09-22 10:54:32 +02:00
extent-tree.c btrfs: handle discard errors in in btrfs_finish_extent_commit() 2026-02-26 15:03:26 +01:00
extent-tree.h btrfs: add do_remap parameter to btrfs_discard_extent() 2026-02-03 07:54:35 +01:00
extent_io.c btrfs: remove out_failed label in find_lock_delalloc_range() 2026-02-03 07:56:22 +01:00
extent_io.h btrfs: do not strictly require dirty metadata threshold for metadata writepages 2026-01-21 19:35:00 +01:00
extent_map.c btrfs: add strict extent map alignment checks 2026-02-03 07:56:19 +01:00
extent_map.h btrfs: headers cleanup to remove unnecessary local includes 2025-11-24 22:34:52 +01:00
fiemap.c btrfs: fix typos in comments and strings 2025-09-23 08:49:16 +02:00
fiemap.h btrfs: move fiemap code into its own file 2024-07-11 15:33:20 +02:00
file-item.c btrfs: remove out label in btrfs_csum_file_blocks() 2026-02-03 07:56:22 +01:00
file-item.h btrfs: introduce btrfs_bio::async_csum 2025-11-24 22:42:21 +01:00
file.c btrfs: remove out label in btrfs_mark_extent_written() 2026-02-03 07:56:22 +01:00
file.h btrfs: update include and forward declarations in headers 2025-03-18 20:35:43 +01:00
free-space-cache.c btrfs: remove pointless out labels from free-space-cache.c 2026-02-03 07:56:21 +01:00
free-space-cache.h btrfs: handle discarding fully-remapped block groups 2026-02-03 07:54:36 +01:00
free-space-tree.c btrfs: use the btrfs_block_group_end() helper everywhere 2026-02-03 07:54:36 +01:00
free-space-tree.h btrfs: handle setting up relocation of block group with remap-tree 2026-02-03 07:54:35 +01:00
fs.c btrfs: switch to library APIs for checksums 2026-02-03 06:38:32 +01:00
fs.h btrfs: fix transaction commit blocking during trim of unallocated space 2026-02-03 07:56:25 +01:00
inode-item.c btrfs: merge setting ret and return ret 2026-02-03 06:38:33 +01:00
inode-item.h btrfs: remove unused parameters from btrfs_lookup_inode_extref() 2025-07-21 23:58:03 +02:00
inode.c btrfs: handle unexpected exact match in btrfs_set_inode_index_count() 2026-02-18 15:25:53 +01:00
ioctl.c btrfs: remove pointless out labels from ioctl.c 2026-02-03 07:56:20 +01:00
ioctl.h tree-wide: s/struct fileattr/struct file_kattr/g 2025-07-04 16:14:39 +02:00
Kconfig btrfs: allow mounting filesystems with remap-tree incompat flag 2026-02-03 07:54:35 +01:00
locking.c btrfs: add definitions and constants for remap-tree 2026-02-03 07:54:02 +01:00
locking.h btrfs: fix typos in comments and strings 2025-09-23 08:49:16 +02:00
lru_cache.c
lru_cache.h btrfs: cleanup recursive include of the same header 2024-07-11 15:33:22 +02:00
lzo.c btrfs: remove the old btrfs_compress_folios() infrastructure 2026-02-03 07:59:07 +01:00
Makefile btrfs: tests: add unit tests for pending extent walking functions 2026-02-03 07:56:25 +01:00
messages.c btrfs: pass level to _btrfs_printk() to avoid parsing level from string 2026-02-03 07:49:10 +01:00
messages.h btrfs: remove ASSERT compatibility for gcc < 8.x 2026-02-03 07:49:10 +01:00
misc.h for-6.19-tag 2025-12-03 20:03:46 -08:00
ordered-data.c for-6.19-tag 2025-12-03 20:03:46 -08:00
ordered-data.h btrfs: introduce a read path dedicated extent lock helper 2025-03-18 20:35:48 +01:00
orphan.c btrfs: BTRFS_PATH_AUTO_FREE in orphan.c 2024-09-10 16:51:22 +02:00
orphan.h
print-tree.c btrfs: use the key format macros when printing keys 2025-11-24 22:03:02 +01:00
print-tree.h btrfs: update include and forward declarations in headers 2025-03-18 20:35:43 +01:00
props.c btrfs: props: switch prop_handler::extract to struct btrfs_inode 2025-03-18 20:35:44 +01:00
props.h btrfs: pass struct btrfs_inode to btrfs_inode_inherit_props() 2025-03-18 20:35:44 +01:00
qgroup.c btrfs: fix invalid leaf access in btrfs_quota_enable() if ref key not found 2026-02-18 15:25:54 +01:00
qgroup.h btrfs: update include and forward declarations in headers 2025-03-18 20:35:43 +01:00
raid-stripe-tree.c btrfs: use bool type for btrfs_path members used as booleans 2025-11-24 22:42:25 +01:00
raid-stripe-tree.h btrfs: update include and forward declarations in headers 2025-03-18 20:35:43 +01:00
raid56.c btrfs: raid56: fix memory leak of btrfs_raid_bio::stripe_uptodate_bitmap 2026-02-03 07:56:25 +01:00
raid56.h btrfs: raid56: introduce a new parameter to locate a sector 2025-11-25 01:46:58 +01:00
ref-verify.c btrfs: ref-verify: fix IS_ERR() vs NULL check in btrfs_build_ref_tree() 2025-10-22 09:40:07 +02:00
ref-verify.h btrfs: move ref-verify under CONFIG_BTRFS_DEBUG 2025-09-22 10:54:32 +02:00
reflink.c btrfs: update comment for delalloc flush and oe wait in btrfs_clone_files() 2026-02-03 07:51:43 +01:00
reflink.h
relocation.c btrfs: populate fully_remapped_bgs_list on mount 2026-02-03 07:54:36 +01:00
relocation.h btrfs: handle setting up relocation of block group with remap-tree 2026-02-03 07:54:35 +01:00
root-tree.c btrfs: fix lost error return in btrfs_find_orphan_roots() 2026-02-18 15:25:54 +01:00
root-tree.h
scrub.c btrfs: remove out label in scrub_find_fill_first_stripe() 2026-02-03 07:56:22 +01:00
scrub.h btrfs: convert several int parameters to bool 2025-09-22 10:54:32 +02:00
send.c btrfs: remove pointless out labels from send.c 2026-02-03 07:56:20 +01:00
send.h btrfs: pass btrfs_root pointers to send ioctl parameters 2025-03-18 20:35:49 +01:00
space-info.c btrfs: remove out label in btrfs_init_space_info() 2026-02-03 07:56:23 +01:00
space-info.h btrfs: move space_info_flag_to_str() to space-info.h 2026-02-03 07:49:12 +01:00
subpage.c for-6.19-tag 2025-12-03 20:03:46 -08:00
subpage.h btrfs: headers cleanup to remove unnecessary local includes 2025-11-24 22:34:52 +01:00
super.c btrfs: zoned: show statistics about zoned filesystems in mountstats 2026-02-03 07:49:12 +01:00
super.h btrfs: change BTRFS_MOUNT_* flags to 64bit type 2024-07-19 17:20:23 +02:00
sysfs.c btrfs: add METADATA_REMAP chunk type 2026-02-03 07:54:27 +01:00
sysfs.h btrfs: remove fs_info argument from btrfs_sysfs_add_space_info_type() 2025-11-24 22:02:30 +01:00
transaction.c btrfs: use the correct type to initialize block reserve for delayed refs 2026-02-18 15:25:53 +01:00
transaction.h btrfs: headers cleanup to remove unnecessary local includes 2025-11-24 22:34:52 +01:00
tree-checker.c btrfs: add extended version of struct block_group_item 2026-02-03 07:54:34 +01:00
tree-checker.h btrfs: add definitions and constants for remap-tree 2026-02-03 07:54:02 +01:00
tree-log.c btrfs: use the btrfs_extent_map_end() helper everywhere 2026-02-03 07:54:36 +01:00
tree-log.h btrfs: reduce arguments to btrfs_del_inode_ref_in_log() 2025-11-25 01:53:33 +01:00
tree-mod-log.c btrfs: reduce size of struct tree_mod_elem 2025-07-22 00:09:20 +02:00
tree-mod-log.h btrfs: drop unused parameter path from btrfs_tree_mod_log_rewind() 2024-11-11 14:34:15 +01:00
ulist.c btrfs: use rb_find_add() in ulist_rbtree_insert() 2025-07-21 23:53:25 +02:00
ulist.h btrfs: preallocate ulist memory for qgroup rsv 2024-07-11 15:33:26 +02:00
uuid-tree.c btrfs: remove pointless out labels from uuid-tree.c 2026-02-03 07:56:21 +01:00
uuid-tree.h btrfs: move uuid tree related code to uuid-tree.[ch] 2024-09-10 16:51:12 +02:00
verity.c btrfs: fix lost return value on error in finish_verity() 2026-02-18 15:25:54 +01:00
verity.h
volumes.c btrfs: replace BUG() with error handling in __btrfs_balance() 2026-02-18 15:25:53 +01:00
volumes.h btrfs: add cleanup function for btrfs_free_chunk_map 2026-02-03 07:59:06 +01:00
xattr.c btrfs: remaining BTRFS_PATH_AUTO_FREE conversions 2025-11-25 01:53:33 +01:00
xattr.h btrfs: update include and forward declarations in headers 2025-03-18 20:35:43 +01:00
zlib.c btrfs: remove the old btrfs_compress_folios() infrastructure 2026-02-03 07:59:07 +01:00
zoned.c btrfs: zoned: factor out the zone loading part into a testable function 2026-02-03 07:59:06 +01:00
zoned.h btrfs: zoned: factor out the zone loading part into a testable function 2026-02-03 07:59:06 +01:00
zstd.c btrfs: remove the old btrfs_compress_folios() infrastructure 2026-02-03 07:59:07 +01:00