From patchwork Thu Feb 15 14:46:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Desnoyers X-Patchwork-Id: 13558535 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 B32A0C48BC4 for ; Thu, 15 Feb 2024 14:46:56 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1A6BE8D0014; Thu, 15 Feb 2024 09:46:44 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 155748D001B; Thu, 15 Feb 2024 09:46:44 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EC7B08D0014; Thu, 15 Feb 2024 09:46:43 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id B48088D001B for ; Thu, 15 Feb 2024 09:46:43 -0500 (EST) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 855B8A2812 for ; Thu, 15 Feb 2024 14:46:43 +0000 (UTC) X-FDA: 81794314686.03.93C1AA0 Received: from smtpout.efficios.com (smtpout.efficios.com [167.114.26.122]) by imf27.hostedemail.com (Postfix) with ESMTP id 13A5540018 for ; Thu, 15 Feb 2024 14:46:41 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=efficios.com header.s=smtpout1 header.b=vDjxseM3; spf=pass (imf27.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=1708008402; 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=XtEDenX6YiEP4kkH9Hkr0ysHEfO7Lt7SdkKLxJS+nHI=; b=JFZui9Sigt8vXiWkfAEfDa9bXYdH1UT3iCu3wmVlGXnohkZGbpxc21EIPDvzV24ErcBEnx MO1sNRdifI6GLlJ0vgMxdm/BUZohdpUjuNM+jfyG+zD4DA94/2cdP3aFh5UAAC4fAY3prz e7HIK/JnFVahMvAuRquihKWT3UEecbU= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1708008402; a=rsa-sha256; cv=none; b=kOmLC77oSCiP7sqzV54MLr8rGSgprtADgDyKbTMY6FjeuDLR85QW9JBbujXNCQBnAQTJyY jXQn6/E0XgMysluihoga3U7kThvBrv+8I0VN/kk54sQJUJQWY6DKppSu22yL/ItAGzB8UF wtLYRkESppaQY//DUacln+OMOCET5Vg= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=pass header.d=efficios.com header.s=smtpout1 header.b=vDjxseM3; spf=pass (imf27.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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=efficios.com; s=smtpout1; t=1708008401; bh=xPtmgWiHU56eIOTTAS+sj/oIA68ksqZ/i5VE/RwV8cI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vDjxseM3uGoNZMHp7D3FWbwVNMSAeAHOAkwaIfhUFXeFVtAl7YV0zsfJqedaxBmDF HghiT/IcBK1PufFC4feeduBoLz3Gp/8+aCkduAWpCMuH6F5jrejmF7Yp4EmaKhhPkl 9pSgL1Hoe/1ufK5c+NUXcvwSCQpEvArM7OhGazL/cnqD32qDqsfp/xlaytSQHIAH6e 0p6b0AtWXgLOH1Aj0000Jk7R+51JOUBfKQXKvzzNkvQ8aKQknVyur2HPUJUtJVdE4r Xxz4siQNkEmiX0+78ojo8dlyKb0loVQa96kddJLDm9aaErHKKPMSEeWOuWwPtv+x3v dfur/tcl6otfQ== 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 4TbHvN67LPzZS8; Thu, 15 Feb 2024 09:46:40 -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, Heiko Carstens , Alasdair Kergon , Mike Snitzer , Mikulas Patocka Subject: [PATCH v6 5/9] dcssblk: Handle alloc_dax() -EOPNOTSUPP failure Date: Thu, 15 Feb 2024 09:46:29 -0500 Message-Id: <20240215144633.96437-6-mathieu.desnoyers@efficios.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240215144633.96437-1-mathieu.desnoyers@efficios.com> References: <20240215144633.96437-1-mathieu.desnoyers@efficios.com> MIME-Version: 1.0 X-Rspamd-Queue-Id: 13A5540018 X-Rspam-User: X-Rspamd-Server: rspam11 X-Stat-Signature: fdi559mdhqob98939pfsu9me8o1mmjz7 X-HE-Tag: 1708008401-392317 X-HE-Meta: U2FsdGVkX1+3JhnWDsJ4ilp3Pctw/AXaRkDLvWKxad33mplcHZQ5G/o1D5HQzoSe59p+PiCifXQVQZamI04m7w79tra5w5EeIgclpWB/YghjAlHgjJD7xVQshMPeRMzeSxUGIEn1WtdQ6qDHp4/FxJPjy8iDrRuXozV+oB/NP1ZncJ0BCTVPUmHBPPWb1gj2+hITQiRNdnrT2Yaz0CgUnQyM3mogPbpbf5FvfxyEU4vsqjNVQrAILcNr7GDe3jgcKzCQGBjiex2EI45HscaJvcx6iSDJs/WNMXTRnt0SVs16GqJBEDRDZ8NkPRMEOtMvEGFG68XMcFx2PhMOS/SBx9LXiYy6HJspbk+GyLmnm3YPr53nR17qohDnXVgLczD297/eaGlNlUugjUfMI79t6jkC9AI1gOcgdJYIxwmf8ltYS9JeV3uWI4vj/582H5CO9qrHExEMAZNx198a6cesIePxUhBIlEUXsc4/oBBtg8chVs4Ngxg1KLJBgRWJepRV+nFSJZ0v22LpqJa9+NdKLNTQPkMWkaOW0u3d5IWXLSUeSaTBWVD/r1UdNBdpZAvFwFHa51QHufl7V/glaX6hPiWFx/26W+XETVn8fWyfnPazJRU5JLDBU6wd1ywwYYYL40opiqInKqOYkkgl9xGC53NP11nq4gU2uqBbnRjjHhGEfeghVKnYLda0XXxhCHj9mXN3ptfT4tkPt9LDDWq8m8cEdvoDLfWMWp7UF2lkiklrjs7LkYxce5eUXDkEQ5eCGwqwusMZB5JrHBq+7hGZozqmrzHzKGPsF0UYMJY8tNqsMHJVhsiDsu+jfjpQPsj8sSnwpMLa7QGlAK4g88roQpnPgJVKnKnRN8u/gZlbY3bFYkWAdkGYCGeEe+uqLCEKS8LcPxM3nN6OU/zyTloy4Ex5KSWKJP824FOiKjh6vANzB0c+AnUgWd6kvmNP6KU7qYS0OEo/wEWqv4Fs1rv lmZayaql uamCTKivb9aTR0tk= 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 Acked-by: Heiko Carstens 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;