Skip to content

Commit 32054a9

Browse files
fdmananagregkh
authored andcommitted
btrfs: abort transaction if we fail to update inode in log replay dir fixup
[ Upstream commit 5a0565c ] 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> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 90542dc commit 32054a9

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

fs/btrfs/tree-log.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1778,6 +1778,8 @@ static noinline int link_to_fixup_dir(struct btrfs_trans_handle *trans,
17781778
else
17791779
inc_nlink(vfs_inode);
17801780
ret = btrfs_update_inode(trans, inode);
1781+
if (ret)
1782+
btrfs_abort_transaction(trans, ret);
17811783
} else if (ret == -EEXIST) {
17821784
ret = 0;
17831785
}

0 commit comments

Comments
 (0)