diff options
| author | Filipe Manana <fdmanana@suse.com> | 2025-09-03 17:43:04 +0100 |
|---|---|---|
| committer | David Sterba <dsterba@suse.com> | 2025-09-23 08:49:21 +0200 |
| commit | 5a0565cad3ef7cbf4cf43d1dd1e849b156205292 (patch) | |
| tree | bfcd4f8d38e361b60045b11237e21977e6ee7925 | |
| parent | 0b7453b7a1c1f8aa1570da2d0cc81bf7691eb5f1 (diff) | |
| download | linux-5a0565cad3ef7cbf4cf43d1dd1e849b156205292.tar.gz linux-5a0565cad3ef7cbf4cf43d1dd1e849b156205292.tar.bz2 linux-5a0565cad3ef7cbf4cf43d1dd1e849b156205292.zip | |
btrfs: abort transaction if we fail to update inode in log replay dir fixup
If we fail to update the inode at link_to_fixup_dir(), we don't abort the
transaction and propagate the error up the call chain, which makes it hard
to pinpoint the error to the inode update. So abort the transaction if the
inode update call fails, so that if it happens we known immediately.
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 | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c index 7b91248b38dc..83b79023baae 100644 --- a/fs/btrfs/tree-log.c +++ b/fs/btrfs/tree-log.c @@ -1849,6 +1849,8 @@ static noinline int link_to_fixup_dir(struct walk_control *wc, u64 objectid) else inc_nlink(vfs_inode); ret = btrfs_update_inode(trans, inode); + if (ret) + btrfs_abort_transaction(trans, ret); } else if (ret == -EEXIST) { ret = 0; } else { |
