diff options
author | Filipe Manana <fdmanana@suse.com> | 2025-06-04 00:06:17 +0300 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2025-06-19 16:20:47 +0300 |
commit | 16edae52f60658caeaa0702e7cb6b738a09d4ad4 (patch) | |
tree | 49378ca6b48884d874b3a0f1acb1300b508e4356 | |
parent | 2dcf838cf5c2f0f4501edaa1680fcad03618d760 (diff) | |
download | linux-16edae52f60658caeaa0702e7cb6b738a09d4ad4.tar.xz |
btrfs: don't silently ignore unexpected extent type when replaying log
If there's an unexpected (invalid) extent type, we just silently ignore
it. This means a corruption or some bug somewhere, so instead return
-EUCLEAN to the caller, making log replay fail, and print an error message
with relevant information.
Reviewed-by: Boris Burkov <boris@bur.io>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
-rw-r--r-- | fs/btrfs/tree-log.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c index 21d2f3dded51..858b609e292c 100644 --- a/fs/btrfs/tree-log.c +++ b/fs/btrfs/tree-log.c @@ -668,7 +668,10 @@ static noinline int replay_one_extent(struct btrfs_trans_handle *trans, extent_end = ALIGN(start + size, fs_info->sectorsize); } else { - return 0; + btrfs_err(fs_info, + "unexpected extent type=%d root=%llu inode=%llu offset=%llu", + found_type, btrfs_root_id(root), key->objectid, key->offset); + return -EUCLEAN; } inode = read_one_inode(root, key->objectid); |