From patchwork Thu Feb 8 18:49:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Desnoyers X-Patchwork-Id: 198536 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp383912dyd; Thu, 8 Feb 2024 10:58:40 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUv31DCvaSorbdTjC0YMM4PCcIXlHemYkp32fuiBZC6/oRcyTYtyC+DTVYz453zvTGvTigAC86HCtd8mG4gyjjiJZOGcg== X-Google-Smtp-Source: AGHT+IGFypVrk/cj8GySpp46lq0zVEKCC1NPpZRopzfY8FRIm1LW0fPO745n4fMbSXyCJA/BLXXM X-Received: by 2002:a25:bfc5:0:b0:dc6:83c:dce7 with SMTP id q5-20020a25bfc5000000b00dc6083cdce7mr364404ybm.38.1707418719919; Thu, 08 Feb 2024 10:58:39 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707418719; cv=pass; d=google.com; s=arc-20160816; b=k/xuRAk2NU8SbES1Ewnk9qB9T5+gzKR1dgSESZ6Qzbs+pXAfFlcRsA2N1gUAXRERUm tyCrHSWvLjvZGbGWuvP0YQ+0dhKCLGCMs46PpPcSmqwUtg4JJejLkt9BqwILDyF8qy9A p2VeBYe5h7w5s+u4BAR/KCTgQwElSQ67BkGgNx59doSKCMzDWGsBS3mhCFrxwWjezS8M c38GiW7hXFfGyxn8Fem4f4xOwO/jYOxX6RF25cGdvy4zQk5Kpsz7Udt2mf0IcJcqcrQJ +1jK0OvsGF1Mk0Q9o5hl/mpYLrCg81BauzmvuzQcuwg3S2rXFiS6ogUHs4kRjyQSuCwz EzOw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=M/l3w5J0gRKX2dpYvmIz6vr4xoT8EtwTyWYFokXaqsQ=; fh=h6XsCQQzXdMo+Ne3qiMK5fLDFsLt3USFXs5HLXwTxYM=; b=vL6wNoM8OemA9+qL0QD7q7MTkvGxcCHp1YleWZoTCgiZxUfByEGJCHB71gWGTITYWo 3CuQW05bbRL10AJXIRGEngTfhq+G97COz2FefQjeJTtK22MTwhmNTj8dUavg5CmpERpV H6idNcTgn12S/PmJt9a96CkbiUsNMD1yRveKPgfQQrvF0eSvzXrkx/sGnLhIWQ1GLep1 gwqAYK4RvFMRv77/BcJeZ+uJavICNtLf/SxYrXPc7lHbQIRWYS8qkA63qB5NN6AVbxan PCWbN+upVOSIUCBmXK1FS732XzOPfgLM3liqbNwU/sZQfjfHezg40TtmMFPw2wnh4C6p HH9Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@efficios.com header.s=smtpout1 header.b=TAhR2aeh; arc=pass (i=1 spf=pass spfdomain=efficios.com dkim=pass dkdomain=efficios.com dmarc=pass fromdomain=efficios.com); spf=pass (google.com: domain of linux-kernel+bounces-58579-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-58579-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=efficios.com X-Forwarded-Encrypted: i=2; AJvYcCUJp+45bkUMxgXpweo/3wjY7lnrkCIuPEX3dMQOYr9ukqfz3tyAHoDoWp81zKDZ9A1/80Xmogr3/yxqaTto1VbwVuY+CA== Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id p21-20020a05620a113500b007831ed5564fsi205177qkk.321.2024.02.08.10.58.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Feb 2024 10:58:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-58579-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@efficios.com header.s=smtpout1 header.b=TAhR2aeh; arc=pass (i=1 spf=pass spfdomain=efficios.com dkim=pass dkdomain=efficios.com dmarc=pass fromdomain=efficios.com); spf=pass (google.com: domain of linux-kernel+bounces-58579-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-58579-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=efficios.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 78A551C2A379 for ; Thu, 8 Feb 2024 18:57:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C2DAD4F8BE; Thu, 8 Feb 2024 18:49:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=efficios.com header.i=@efficios.com header.b="TAhR2aeh" Received: from smtpout.efficios.com (smtpout.efficios.com [167.114.26.122]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9829625634; Thu, 8 Feb 2024 18:49:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=167.114.26.122 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707418178; cv=none; b=Ek5xibD5ebuoaITrFAhKuU1azeoOi5TEcx6IlytFjXMbgofs5IkklisuPA6UJR25utJ2LFHKM539yvKZrrgELWQ1OAd6mhWyb+1n7NXZqhJeLLQyOkMvt6ALCn80Po4W/aEe8cuDqmFi/xvO0etuEYA6L/4mgjMjraC391mdoGM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707418178; c=relaxed/simple; bh=3qwtk0TzM3yqkpdWTkMn8G1D7Yvm6JJDP82nQNcfpzk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=EdHb3WzvT7aVq+5nmlb7miLkhblJvZib0QY1ssaDyvLWy7WeQD+RvH1oaVR1hONV57+QXNP3P0+6S9vRcg4f6J7+Rrzc4geuprWleqWo27mmw9s0IpP2sg85QI0jM+LIN6F6Bpd8roO2j7jhHTwXMWZTvzaKm8CUvRYkC6/skT4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=efficios.com; spf=pass smtp.mailfrom=efficios.com; dkim=pass (2048-bit key) header.d=efficios.com header.i=@efficios.com header.b=TAhR2aeh; arc=none smtp.client-ip=167.114.26.122 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=efficios.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=efficios.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=efficios.com; s=smtpout1; t=1707418167; bh=3qwtk0TzM3yqkpdWTkMn8G1D7Yvm6JJDP82nQNcfpzk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TAhR2aehSVIy+7kxOHR6NVnmGYlp9kd5ycnTSBAI6hceetyhQOWUUfcm/nFiep+a1 kEkco0j8ZB4aI7AGUsK7I6wOE9xdzR/fBQB/pGe+tbFE1K6mzmAeXB5d7S7zA0bRWj ip3Ju2dZR0HVfK7H2Y2FckrBH/MiPVeZX1zh4NiDcc1BLONE3/lFUOu67rYwA1XBw6 zqyIy2GXXYMOivh7iSp4mwMGUu1002g4dcG4icNksUO16LHayffi2x7O5HtglehPmp B5lutv1FF5uLG4qLTgKWQTdXfMpywAxesrzwZXGsCyTz/972b+6tAcEMA0N6RREPQK fjRsnlrFyE3ww== Received: from thinkos.internal.efficios.com (192-222-143-198.qc.cable.ebox.net [192.222.143.198]) by smtpout.efficios.com (Postfix) with ESMTPSA id 4TW5ck5SmGzY2M; Thu, 8 Feb 2024 13:49:26 -0500 (EST) From: Mathieu Desnoyers To: Dan Williams , Arnd Bergmann , Dave Chinner Cc: linux-kernel@vger.kernel.org, Mathieu Desnoyers , Andrew Morton , Linus Torvalds , Vishal Verma , Dave Jiang , Matthew Wilcox , Russell King , linux-arch@vger.kernel.org, linux-cxl@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-xfs@vger.kernel.org, dm-devel@lists.linux.dev, nvdimm@lists.linux.dev, linux-s390@vger.kernel.org, Alasdair Kergon , Mike Snitzer , Mikulas Patocka Subject: [PATCH v4 10/12] dm: Cleanup alloc_dax() error handling Date: Thu, 8 Feb 2024 13:49:11 -0500 Message-Id: <20240208184913.484340-11-mathieu.desnoyers@efficios.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240208184913.484340-1-mathieu.desnoyers@efficios.com> References: <20240208184913.484340-1-mathieu.desnoyers@efficios.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790358291573630160 X-GMAIL-MSGID: 1790358291573630160 Now that alloc_dax() returns ERR_PTR(-EOPNOTSUPP) rather than NULL, the callers do not have to handle NULL return values anymore. Signed-off-by: Mathieu Desnoyers Cc: Alasdair Kergon Cc: Mike Snitzer Cc: Mikulas Patocka Cc: Andrew Morton Cc: Linus Torvalds Cc: Dan Williams Cc: Vishal Verma Cc: Dave Jiang Cc: Matthew Wilcox Cc: Arnd Bergmann Cc: Russell King Cc: linux-arch@vger.kernel.org Cc: linux-cxl@vger.kernel.org Cc: linux-fsdevel@vger.kernel.org Cc: linux-mm@kvack.org Cc: linux-xfs@vger.kernel.org Cc: dm-devel@lists.linux.dev Cc: nvdimm@lists.linux.dev --- drivers/md/dm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/md/dm.c b/drivers/md/dm.c index 2fc22cae9089..acdc00bc05be 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c @@ -2124,8 +2124,8 @@ static struct mapped_device *alloc_dev(int minor) sprintf(md->disk->disk_name, "dm-%d", minor); dax_dev = alloc_dax(md, &dm_dax_ops); - if (IS_ERR_OR_NULL(dax_dev)) { - if (IS_ERR(dax_dev) && PTR_ERR(dax_dev) != -EOPNOTSUPP) + if (IS_ERR(dax_dev)) { + if (PTR_ERR(dax_dev) != -EOPNOTSUPP) goto bad; } else { set_dax_nocache(dax_dev);