From patchwork Mon Feb 12 16:30:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Desnoyers X-Patchwork-Id: 13553521 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 989CCC4829C for ; Mon, 12 Feb 2024 16:31:14 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id F3D196B0088; Mon, 12 Feb 2024 11:31:07 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id E9EBE6B0087; Mon, 12 Feb 2024 11:31:07 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C35ED6B008C; Mon, 12 Feb 2024 11:31:07 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 9D5106B0088 for ; Mon, 12 Feb 2024 11:31:07 -0500 (EST) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 79DC812092E for ; Mon, 12 Feb 2024 16:31:07 +0000 (UTC) X-FDA: 81783691374.11.0D93242 Received: from smtpout.efficios.com (smtpout.efficios.com [167.114.26.122]) by imf22.hostedemail.com (Postfix) with ESMTP id D7047C0011 for ; Mon, 12 Feb 2024 16:31:05 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=efficios.com header.s=smtpout1 header.b=Zyy41IcN; spf=pass (imf22.hostedemail.com: domain of mathieu.desnoyers@efficios.com designates 167.114.26.122 as permitted sender) smtp.mailfrom=mathieu.desnoyers@efficios.com; dmarc=pass (policy=none) header.from=efficios.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1707755465; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=gKli+dHZYbYl5NcIKVupWlrpR3NX93t10pIkv+yAmpY=; b=tt9hwKu1VCMifGZzAdt8i+dgJ/Tph6UdX2AsO25plbB5MkrkNUG3UNPDvoBf2SjP+XqcWq NqxKGQ+RxRR6Tq5WIQc381e7j5+Ps+Jkt4XsYnLdPwYjLgIAkjVuRLR7hLOAxdoEZ8c8NU 3RZqDZnJPCIWzz7E34MA5iljwMvEwaE= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=pass header.d=efficios.com header.s=smtpout1 header.b=Zyy41IcN; spf=pass (imf22.hostedemail.com: domain of mathieu.desnoyers@efficios.com designates 167.114.26.122 as permitted sender) smtp.mailfrom=mathieu.desnoyers@efficios.com; dmarc=pass (policy=none) header.from=efficios.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1707755465; a=rsa-sha256; cv=none; b=uqMvasVRi2x/UiKq2E8osq05/WhvOFUy2vIPXvnlwE9bvwKpXy69jKgaciP5mB9Ergvo0t gs7ZJZjLfqdlCn8uWr0iWrqwr0TiH6rXdhz+lirqc8P2qLzIVnM5tO44rWw780ycL3bMUC TwXusKIi4rg47AKAKlbVri1HYlqLsr4= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=efficios.com; s=smtpout1; t=1707755465; bh=I3VS2JL5QdpOumZEunORNSa20I7SphHpfPnc7uZLU3E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Zyy41IcNoqtQbIMqRtQkRf04RF8pHGrvLxtkDunUMa3xLSO7TDS/UTVZLcYlA50F0 W1hr+wGMM+ODEVJNO4I89b0Uom5QMH6vetzyPPSevwF0jTDeRAeWyJFGpQqGwx0eWr +nL5vdHpKPv75vPDGb9eGpvPBmp11fTrfr31D6F9z1Z+eosGAw+BFPLxftCWsSy0LT voSfnVGo10xz/kQWoJRH8ILXBsiTAZ/oyHYutOC88YWMjNsXImVaA1M+mXDKeE+dOh zs2AqPHYZ0nsKgPKHRTMA2OXeYdoYlGm8PVTtqi7NNaA7c2CWs7eXGRGoX+ksIqy5D uaViYgjXjXozQ== 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 4TYVMD5XlbzYCW; Mon, 12 Feb 2024 11:31:04 -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 v5 4/8] dcssblk: Handle alloc_dax() -EOPNOTSUPP failure Date: Mon, 12 Feb 2024 11:30:57 -0500 Message-Id: <20240212163101.19614-5-mathieu.desnoyers@efficios.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240212163101.19614-1-mathieu.desnoyers@efficios.com> References: <20240212163101.19614-1-mathieu.desnoyers@efficios.com> MIME-Version: 1.0 X-Rspamd-Queue-Id: D7047C0011 X-Rspam-User: X-Stat-Signature: q68fak4o39q837i77a7zstjkm18wx9xs X-Rspamd-Server: rspam01 X-HE-Tag: 1707755465-827346 X-HE-Meta: U2FsdGVkX1+NWO+Q30S/nEhpMXr980KxPMINDNYtf5vf1phCq6CrXL7oYnHWEUlVXpmd1jjSqKQ4d3GC7Leun/kARQe9YXVnMH836CcWNMP9E6rC1EC6mW8t76/lj9ATBJRqh6ZV4Jv/RMkP5iRLh4fMek7ayEyvt9R1YzojZBgxRWWsFP9e757nhxVms1FDEXnLelixm0GY3mrVLeWPaQqUzDVftE8DZJAffFpBWZ09uZ7RkyHQnYMScIZOmpp+96FaGnLtpAG8aJ/rwMH8Kqz1qZ0ftqQ1bk4HartWHQpp41a9W6HPLsgGJnSGmCHk5sm790D110p/vZNiPups74BUOi+S3UJpAfiIarazv1HBYPr33PVlwFnESjqbm22TZSJruYanZVw6yBdW1/xsDZ3OZQs2FlNy8Wh3bua/ULtX+GMt6vTwVCmdeyxKnRL8e3WPBMA511xotcgqEjDOaG49/n+NJRJjUXG3VctE7dAqBufxQGYZNNtXSPGqaom8Yws47+1JfZ7Cku+B+zkma5X1qeDwZ7Igo6IElh+23WSnbottqSrvSk808FYlqk7ju4ygIiHdveskiMgkq+O/4BA2fCw3KWSrwUiUlJX4Zpfj17EcvMyp+WxM9TMNpIYaXZnz3TEU6JMOd/MRmMgXoMwPkLMw49lgcE/K+2YR086TseNuTb7sMQn8zGMHoXI9HSX38PW2gRYSMFMO5BPmpnn1JcOP5lXPMpwGOJpv9EiP5nOHL/Sa60w7t+d4oVLJ5A9S1VW7+xse4cI/yGViCXLpXSFRZc3VKJH/xMIdCap9luWC8QnGWIKIcQxm6i6edxA3Bae5cN3ymdGZsSrrcqSzhCTY8SWgZwJ5xiJPHBZH1JERlJKryE1WRzmrFErHQfKNnRAuEAIPbWqtPvKiXRCFeOTeNCnYEoH5XASZTeRXMugj8xdeGhFHXtMKmO44fiQ5qbKR6qsvLVQpub7 FRZ7lYIf gHPYilVck07OjZgw= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: In preparation for checking whether the architecture has data cache aliasing within alloc_dax(), modify the error handling of dcssblk dcssblk_add_store() to handle alloc_dax() -EOPNOTSUPP failures. Considering that s390 is not a data cache aliasing architecture, and considering that DCSSBLK selects DAX, a return value of -EOPNOTSUPP from alloc_dax() should make dcssblk_add_store() fail. Fixes: d92576f1167c ("dax: does not work correctly with virtual aliasing caches") Signed-off-by: Mathieu Desnoyers Reviewed-by: Dan Williams 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 Cc: linux-s390@vger.kernel.org Acked-by: Heiko Carstens --- drivers/s390/block/dcssblk.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/s390/block/dcssblk.c b/drivers/s390/block/dcssblk.c index 4b7ecd4fd431..f363c1d51d9a 100644 --- a/drivers/s390/block/dcssblk.c +++ b/drivers/s390/block/dcssblk.c @@ -549,6 +549,7 @@ dcssblk_add_store(struct device *dev, struct device_attribute *attr, const char int rc, i, j, num_of_segments; struct dcssblk_dev_info *dev_info; struct segment_info *seg_info, *temp; + struct dax_device *dax_dev; char *local_buf; unsigned long seg_byte_size; @@ -677,13 +678,13 @@ dcssblk_add_store(struct device *dev, struct device_attribute *attr, const char if (rc) goto put_dev; - dev_info->dax_dev = alloc_dax(dev_info, &dcssblk_dax_ops); - if (IS_ERR(dev_info->dax_dev)) { - rc = PTR_ERR(dev_info->dax_dev); - dev_info->dax_dev = NULL; + dax_dev = alloc_dax(dev_info, &dcssblk_dax_ops); + if (IS_ERR(dax_dev)) { + rc = PTR_ERR(dax_dev); goto put_dev; } - set_dax_synchronous(dev_info->dax_dev); + set_dax_synchronous(dax_dev); + dev_info->dax_dev = dax_dev; rc = dax_add_host(dev_info->dax_dev, dev_info->gd); if (rc) goto out_dax;