Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp2560391rdb; Mon, 12 Feb 2024 08:37:18 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUIcFWKZtQgXIJiQXBjG5JCMf2sRbkfsuZSFqP3g/qDI8TPTVAP4af85NcR7UF+X3EX738XTcl9d3PjC57Bix7qssE7W1qn7oWcLdPr6A== X-Google-Smtp-Source: AGHT+IGvlb41j3OI4mPJhbeC3eRr8/FiU7X1zmdBwObKnUamB2V1sDILUwy+byCCVJkJz3PTyzyU X-Received: by 2002:a17:906:7c7:b0:a3c:e99f:c08f with SMTP id m7-20020a17090607c700b00a3ce99fc08fmr176081ejc.40.1707755837900; Mon, 12 Feb 2024 08:37:17 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707755837; cv=pass; d=google.com; s=arc-20160816; b=O5f9FAvU8hW6qQkJ1bvPaSpD1gpkICcQ90adP56bmcClGw57kRoMYS4rbGYdHJpRiD 3IDtkUfO1s0rrNcJMFSouZq0tUu2lklWYQq+XfP9z3WhI8r6w2XpTicN9KFuuZY0OMUo 5zN9uNVTNSLoxQhiKrLqDI8nkrrqt3itqvfym3GJgsmiCv7DLe/CXX8OraJvhsVlGP2r 0kKlMOCUpwwChaxgtrGqlU4jA8zFfaqRjx3CR6i/oy4yPbA2HSuLKQTSY1XOuT+1uNH/ 9F0irTnpgjRXtTg8mcR/boeZoatyzDQgo/MEitzlwRu/tFZdMhvYgLHLbbUctBARI3dg oNmw== 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=gKli+dHZYbYl5NcIKVupWlrpR3NX93t10pIkv+yAmpY=; fh=kejn7hKvL0KgPY1qnqkyRHHFvqpm8iwF3cxpTmitJ2A=; b=j5NzMhVbysnpB41DEYf5k4m5Bo7iwaVke4RdcrC9KLf+bIt8xebOSJGa1fAqWsv4mH 8Iada9Qoa1GV3v666dysCiDtogAEIZzS+V0wF/h26hXji/3xST5ueuCb8lKpXvC5+J5k 47zg3E0tCUb6a8I7COwLy8wLdFzCpsNZfAhNbr974olZt+JhRcq/YsKQ4EbFRVxcf503 EPKNAAHIiSWpw7t7rfNMJGqOXfSmaYZSlcAEhbCrFZ1NRSMe85EwutZ2pkw1VO/+EV5/ AhooneJF+UT2qnO9Pt7pwZMxAQpFksER4lsHffDsaK4MX1/ptLQFYwysfJ5zOKS9NuHy B5/w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@efficios.com header.s=smtpout1 header.b=Zyy41IcN; 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-61982-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-61982-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=efficios.com X-Forwarded-Encrypted: i=2; AJvYcCUD7MGggKAMz2HiCxkSL7hfx4XNCggqcAD09Fm+uO4Ss0P7BWaP4KpFDeiLQmlzerPXDzAB7hNIZZ213mWWrzUJuipxSWWzZtJ+ljCwdg== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id g10-20020a1709061c8a00b00a3baa7d59f3si340786ejh.772.2024.02.12.08.37.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 08:37:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-61982-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@efficios.com header.s=smtpout1 header.b=Zyy41IcN; 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-61982-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-61982-linux.lists.archive=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 am.mirrors.kernel.org (Postfix) with ESMTPS id A41671F2318F for ; Mon, 12 Feb 2024 16:37:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 600174CE02; Mon, 12 Feb 2024 16:31:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=efficios.com header.i=@efficios.com header.b="Zyy41IcN" 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 EC9B63D0DD; Mon, 12 Feb 2024 16:31:05 +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=1707755468; cv=none; b=tgJ66TlGDzpyT3wNKUS+jjyBwkvno+OpevYCqq7+5OMLWltJuzYovyhjnaCseHLqPP61RYHpLarvTccWUCBiF4yTdc31aK8Z4t7JNO0ncWmAMP8LkYxEKsRg8Xof8gbFhdrjKnuTPLKmWy1T4M5io6aXeLMKj4EQFKiI961kdBA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707755468; c=relaxed/simple; bh=I3VS2JL5QdpOumZEunORNSa20I7SphHpfPnc7uZLU3E=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=sV8Hhc+I7YG3Z54Mv/HIjSp9Pfkyar3MPhBxVry1odJjxCHVidPpzzPRAX8Zh9d6ZPZoB/FpJ6fiaI6PWCVbJ1xjyyp5lSCvhx7/Oimb6bUKt1+zjFJFy508wzFO7a/Md4yxOOJdmcAvigzmEDCoMdlOaZNAwCao+1iOmHziKa8= 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=Zyy41IcN; 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=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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 --- 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; -- 2.39.2