From patchwork Fri Feb 4 12:06:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 12735015 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 14774C433EF for ; Fri, 4 Feb 2022 12:06:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233067AbiBDMGe (ORCPT ); Fri, 4 Feb 2022 07:06:34 -0500 Received: from esa6.hgst.iphmx.com ([216.71.154.45]:26466 "EHLO esa6.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230179AbiBDMGe (ORCPT ); Fri, 4 Feb 2022 07:06:34 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1643976395; x=1675512395; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=kp6xSHCU0pBFLOGTH1+N4MuTwHCvIaNlUd5Y2yXsV4s=; b=AAErWGtquoDkW+nqZNxy8g1B/GiXcs1b13q0/XwLb7xJBqWDgLPeGE0C FfbdpCDq14joPiX0gDO5cIxOJ/wE9/HMtxJxC0fqlT5dGPve03BeSt4hw dQ5R4ViCiLamfDi5uYnVWmR1SuMERamBZnHcWG6JUO6wAwJrS/vJjaUHr 2AAWRl0Cz9G3zn3EWg2hPMiqzVIKpzdDiyrSOcMkKkcNpaVX5qKeU5Yyq 6C7h+RpShWnCXMRZIEGeEpmTTdHiICzn+50+H4Jbt/MTRrY6YO0X6ZXYN GNiAjyYqtkUofptm7ZvHlGxIeeetuofK8rvmfgllsjAZn/rY+J/r2Wqe2 w==; X-IronPort-AV: E=Sophos;i="5.88,342,1635177600"; d="scan'208";a="193148752" Received: from h199-255-45-15.hgst.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 04 Feb 2022 20:06:34 +0800 IronPort-SDR: Bm3fX7SKvwv2S1avOK/Xl9DmquAWKgK99LqZ//DIUbyXGGz+tSvzlP4S/p26yyWC3eIteC8nlC wq9ccG7xV5hfY/ThRBVWQFNZvPr1U0tbg9/hNjQ1m36AITpjvJQTJqnzVrKyMPiOG3umGR/vla NGQ1I9H4IS7yNm5ZKyuAfCuKlsuW13eTidvxRls8Mt6fivcxE4YSj/CqCMa9Aolklgvaecj4gl xLtSMnFBJ5+HegLqj722rDeBGEPLKNy1taDjBSY5ctJG6dxjj6iFsFlQn0+zFbcCvySXDwPR1I ULrmsfDGflnLLoaM/fG59hVh Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Feb 2022 03:38:28 -0800 IronPort-SDR: PUb2Od7o2XlZ1ZXznNmkO8+nXNz9+12cuLA+TQeRwy7fZb/CDm5fe4XOGXfYzdtTJm2ccdesvm nB8nKK20LNnmhl4PigxaeklAlsjc6+Xe31ONK0dAS0iqhNRFOjpF0rse79wU+8x7yxh/ud9xIe UokxB5OyiyCx5bpJJbLzXx5Z47hpkx4McbuFwIk/cHKKBnSrAjaOw4TpDyEXWL2g6qPXXwQseI QxYFQHM2o+rJkvC+DFwGqMGNpvUqv0wHNkE1RE5SNYtaX3qutIOTaes5Nzx7ni3jj39iq4aqm6 nxc= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.72]) by uls-op-cesaip02.wdc.com with ESMTP; 04 Feb 2022 04:06:33 -0800 From: Johannes Thumshirn To: David Sterba Cc: Johannes Thumshirn , linux-btrfs@vger.kernel.org, Filipe Manana Subject: [PATCH] btrfs: stop checking for NULL return from btrfs_get_extent_fiemap() Date: Fri, 4 Feb 2022 04:06:27 -0800 Message-Id: <90e3cf42e593327159cd261d71da2bedb53cc562.1643976372.git.johannes.thumshirn@wdc.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org In get_extent_skip_holes() we're checking the return of btrfs_get_extent_fiemap() for an error-pointer or NULL, but btrfs_get_extent_fiemap() will never return NULL, only error-pointers or a valid extent_map. The other caller of btrfs_get_extent_fiemap(), find_desired_extent(), correctly only checks for error-pointers. Cc: Filipe Manana Signed-off-by: Johannes Thumshirn Reviewed-by: Filipe Manana --- fs/btrfs/extent_io.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index 409bad3928db..ad3d8e53a75a 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c @@ -5390,7 +5390,7 @@ static struct extent_map *get_extent_skip_holes(struct btrfs_inode *inode, break; len = ALIGN(len, sectorsize); em = btrfs_get_extent_fiemap(inode, offset, len); - if (IS_ERR_OR_NULL(em)) + if (IS_ERR(em)) return em; /* if this isn't a hole return it */