From: Mark Harmstone Date: Wed, 18 Feb 2026 12:41:00 +0000 (+0000) Subject: btrfs: fix placement of unlikely() in btrfs_insert_one_raid_extent() X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b6193a891653efcd8d6d39610ace204e157bed00;p=thirdparty%2Fkernel%2Flinux.git btrfs: fix placement of unlikely() in btrfs_insert_one_raid_extent() Fix the unlikely added to btrfs_insert_one_raid_extent() by commit a929904cf73b65 ("btrfs: add unlikely annotations to branches leading to transaction abort"): the exclamation point is in the wrong place, so we are telling the compiler that allocation failure is actually expected. Reviewed-by: Filipe Manana Signed-off-by: Mark Harmstone Reviewed-by: David Sterba Signed-off-by: David Sterba --- diff --git a/fs/btrfs/raid-stripe-tree.c b/fs/btrfs/raid-stripe-tree.c index 2987cb7c686ea..638c4ad572c99 100644 --- a/fs/btrfs/raid-stripe-tree.c +++ b/fs/btrfs/raid-stripe-tree.c @@ -300,7 +300,7 @@ int btrfs_insert_one_raid_extent(struct btrfs_trans_handle *trans, int ret; stripe_extent = kzalloc(item_size, GFP_NOFS); - if (!unlikely(stripe_extent)) { + if (unlikely(!stripe_extent)) { btrfs_abort_transaction(trans, -ENOMEM); btrfs_end_transaction(trans); return -ENOMEM;