From patchwork Wed Aug 19 15:42:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Adrian Huang X-Patchwork-Id: 11724513 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9FC2B618 for ; Wed, 19 Aug 2020 15:41:37 +0000 (UTC) Received: from ml01.01.org (ml01.01.org [198.145.21.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6EC2B2063A for ; Wed, 19 Aug 2020 15:41:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="l3QmwBvQ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6EC2B2063A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-nvdimm-bounces@lists.01.org Received: from ml01.vlan13.01.org (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 2D0C51342F39D; Wed, 19 Aug 2020 08:41:37 -0700 (PDT) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2607:f8b0:4864:20::642; helo=mail-pl1-x642.google.com; envelope-from=adrianhuang0701@gmail.com; receiver= Received: from mail-pl1-x642.google.com (mail-pl1-x642.google.com [IPv6:2607:f8b0:4864:20::642]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id F00F21342F38C for ; Wed, 19 Aug 2020 08:41:35 -0700 (PDT) Received: by mail-pl1-x642.google.com with SMTP id bh1so10993615plb.12 for ; Wed, 19 Aug 2020 08:41:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=MR6pDQU/pCrfoo6cohrKXAcJ2u5y3qBI5bx+uWcEzzw=; b=l3QmwBvQg1tI8T+hdzblp52YmrIPsGodBDi0tupyUv/mL6oPSaivJkQTTb89Xg6TDh NZjOOQpC1dSEuHEWt49eAOteddvz0nD6lDNKIU6WfO4b9T3pVsC/rY/xG5x+22vNfis6 QI1zyR7hHHAR8LeXJXzdlb8lzf3/XqfB6W6z1xpTZ57dPeGDZ1b0C+fAkxUiAcxYUKi8 P0AxlNF5zxV2lYXbuFt2IKlvA0i9JK/rbOsSKUsvZpAXV4DagnQ1Q2LUWYqlpJ3tIQCc 5CseMqIsqi+oDgzM9rjCyZ5UGuyRWiw9JRPLPnoFDaqj4dbskkJheWXbXgnuVHNmXGFu ftrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=MR6pDQU/pCrfoo6cohrKXAcJ2u5y3qBI5bx+uWcEzzw=; b=Kv0RKML32Q1LU281U+0dJQ6oc02rgjj265F7/EHG2ME9DipSiugs9fi9pPLyXUJbnd yrzR9xlL5p7Lf5vGz6vT46HUH5LdUbG6FarKb2xOD8/aEpdJPQDkUxmGbx3eB/2wuv7o 9P/SQfInQxDG5GLDk5DboNhpo5C7JL6yrTlGPHfLQzZv4bD5VJq+pYik978CSWOku7HU wM+ch3FIaGUkUNW6o3ye5DFc4ozZ28YUnSmsIfDSuNOl7VE1dg/7lWuEw6uohb0fgX9Q D46evxzSs4JtYAs1VM0I/s07nZh0p3EpbqdQuKibXpM2kRX+wd8FQnbPXVWOERex687O +r/Q== X-Gm-Message-State: AOAM5337l/9YDxFf8WCH6xPyoBbXc4596cKGgtUm2uEujGNFFXLwbCiD B43PdBkxPInXeSAFjP44CmFu7qSQy/HZrg== X-Google-Smtp-Source: ABdhPJwmPg/yfBXaNW/MjehltVmLyM8tfWaa4tSE3SIsEW+yZwX6Nu/8kwz0+p4iCx66XTQuid9J1g== X-Received: by 2002:a17:902:6545:: with SMTP id d5mr16273252pln.257.1597851695107; Wed, 19 Aug 2020 08:41:35 -0700 (PDT) Received: from AHUANG12-1LT7M0.lenovo.com (220-143-146-169.dynamic-ip.hinet.net. [220.143.146.169]) by smtp.googlemail.com with ESMTPSA id a8sm14033777pga.69.2020.08.19.08.41.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Aug 2020 08:41:34 -0700 (PDT) From: Adrian Huang To: linux-nvdimm@lists.01.org Subject: [PATCH 1/1] dax: do not print error message for non-persistent memory block device Date: Wed, 19 Aug 2020 23:42:36 +0800 Message-Id: <20200819154236.24191-1-adrianhuang0701@gmail.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Message-ID-Hash: RFA3QBKQ24LXMGZYDECELG24UJ4RKLUK X-Message-ID-Hash: RFA3QBKQ24LXMGZYDECELG24UJ4RKLUK X-MailFrom: adrianhuang0701@gmail.com X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation CC: Adrian Huang , Coly Li , Alasdair Kergon , Mike Snitzer X-Mailman-Version: 3.1.1 Precedence: list List-Id: "Linux-nvdimm developer list." Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: From: Adrian Huang From: Adrian Huang Commit 231609785cbf ("dax: print error message by pr_info() in __generic_fsdax_supported()") happens to print the following error message during booting when the non-persistent memory block devices are configured by device mapper. Those error messages are caused by the variable 'dax_dev' is NULL. Users might be confused with those error messages since they do not use the persistent memory device. Moreover, users might scare about "what's wrong with my disks" because they see the 'error' and 'failed' keywords. # dmesg | grep fail sdk3: error: dax access failed (-95) sdk3: error: dax access failed (-95) sdk3: error: dax access failed (-95) sdk3: error: dax access failed (-95) sdk3: error: dax access failed (-95) sdk3: error: dax access failed (-95) sdk3: error: dax access failed (-95) sdk3: error: dax access failed (-95) sdk3: error: dax access failed (-95) sdb3: error: dax access failed (-95) sdb3: error: dax access failed (-95) sdb3: error: dax access failed (-95) sdb3: error: dax access failed (-95) sdb3: error: dax access failed (-95) sdb3: error: dax access failed (-95) sdb3: error: dax access failed (-95) sdb3: error: dax access failed (-95) sdb3: error: dax access failed (-95) # lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 1.1T 0 disk ├─sda1 8:1 0 156M 0 part ├─sda2 8:2 0 40G 0 part └─sda3 8:3 0 1.1T 0 part sdb 8:16 0 1.1T 0 disk ├─sdb1 8:17 0 600M 0 part ├─sdb2 8:18 0 1G 0 part └─sdb3 8:19 0 1.1T 0 part ├─rhel00-swap 254:3 0 4G 0 lvm ├─rhel00-home 254:4 0 1T 0 lvm └─rhel00-root 254:5 0 50G 0 lvm sdc 8:32 0 1.1T 0 disk sdd 8:48 0 1.1T 0 disk sde 8:64 0 1.1T 0 disk sdf 8:80 0 1.1T 0 disk sdg 8:96 0 1.1T 0 disk sdh 8:112 0 3.3T 0 disk ├─sdh1 8:113 0 500M 0 part /boot/efi ├─sdh2 8:114 0 40G 0 part / ├─sdh3 8:115 0 2.9T 0 part /home └─sdh4 8:116 0 314.6G 0 part [SWAP] sdi 8:128 0 1.1T 0 disk sdj 8:144 0 3.3T 0 disk ├─sdj1 8:145 0 512M 0 part └─sdj2 8:146 0 3.3T 0 part sdk 8:160 0 119.2G 0 disk ├─sdk1 8:161 0 200M 0 part ├─sdk2 8:162 0 1G 0 part └─sdk3 8:163 0 118G 0 part ├─rhel-swap 254:0 0 4G 0 lvm ├─rhel-home 254:1 0 64G 0 lvm └─rhel-root 254:2 0 50G 0 lvm sdl 8:176 0 119.2G 0 disk The call path is shown as follows: dm_table_determine_type dm_table_supports_dax device_supports_dax generic_fsdax_supported __generic_fsdax_supported With the disk configuration listing from the command 'lsblk', the member 'dev->dax_dev' of the block devices 'sdb3' and 'sdk3' (configured by device mapper) is NULL in function generic_fsdax_supported() because the member is configured in function open_table_device(). To prevent the confusing error messages in this scenario (this is normal behavior), just print those error messages by pr_debug() by checking if dax_dev is NULL and the block device does not support DAX. Fixes: 231609785cbf ("dax: print error message by pr_info() in __generic_fsdax_supported()") Cc: Coly Li Cc: Dan Williams Cc: Alasdair Kergon Cc: Mike Snitzer Signed-off-by: Adrian Huang Acked-by: Coly Li --- drivers/dax/super.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/dax/super.c b/drivers/dax/super.c index c82cbcb64202..32642634c1bb 100644 --- a/drivers/dax/super.c +++ b/drivers/dax/super.c @@ -100,6 +100,12 @@ bool __generic_fsdax_supported(struct dax_device *dax_dev, return false; } + if (!dax_dev && !bdev_dax_supported(bdev, blocksize)) { + pr_debug("%s: error: dax unsupported by block device\n", + bdevname(bdev, buf)); + return false; + } + id = dax_read_lock(); len = dax_direct_access(dax_dev, pgoff, 1, &kaddr, &pfn); len2 = dax_direct_access(dax_dev, pgoff_end, 1, &end_kaddr, &end_pfn);