Received: by 2002:a5d:925a:0:0:0:0:0 with SMTP id e26csp508882iol; Thu, 9 Jun 2022 08:06:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxrH+2vCN/dVAtOMkMd6e3PDDXNJxF4azgjE5wmEN012t5/HedI3zPxb8OpyFRAqQqzpWQk X-Received: by 2002:a17:907:2992:b0:70c:4ddf:5d88 with SMTP id eu18-20020a170907299200b0070c4ddf5d88mr32627255ejc.20.1654787216331; Thu, 09 Jun 2022 08:06:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654787216; cv=none; d=google.com; s=arc-20160816; b=fKRHQh5kO3CYCcCViTl2JIDNuSEZYg/kmOsMmIEvkcJaJC0r2l0f3QYs2PQXBweXR2 LQv09aUzEvNmTa+0g+RBRTSi+wzcFkVJdB7+W+CjGQwYzZILFMaD3aHxnjij5tDKQ+DI G+2mN/Uu7kFJ45/rYxRt/I4G2omwCTDP6dsv4eDX0vIDHqY8GkAWKZavDiOX4fFy69Wd Jbbkb6jTfUW8AKa0jPpJCmdxMaJmDdq0uBUEAaAHZ5slgXnB+IT8fzC694GdU6oat+R2 Sxy/uPfQSdrmdrLU/U5hEfn/ukNbJsxccKgC253tvZQzwpYdBdjc0l/jmkxntS3I9OBv 9GQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:ironport-hdrordr:ironport-data; bh=sYTjWZRT9nJ9H/2VsiKkJIKrRJFDaiFXemMfwKxib+U=; b=W3VWgQ1f1xOH0UstR09YqRs6lPsURpDiMqwwBShyQ6bFZwfNUCYcI8Ua134HhafoNc zZQEe6mgkbvz1fOPM1il0ZCL2rFGqglpMo+dj/IhAq4AvjMECxHsywGF+xdHu5yAnsaZ vOrM0YUsPLZB+Xii8fvbfp80o4k8eIjbFewrxj/m5hiahr9oDQ2eIzLrSWQy9P+hpDWg mviyW9W30bJo2F5arkiMIXj0HLGRv09i+yMDyaBN2xwEbBf4cAgflsCjw/JjV7Ok3G+F r5V3zHYAum51dNWsb68f2JJDocfo1KrIa7/nEfUb7CRWVUk6FsSrWlAR1HYI2dAZQgOp azGQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=fujitsu.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q13-20020a056402248d00b0043329c77c19si3738322eda.442.2022.06.09.08.06.23; Thu, 09 Jun 2022 08:06:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=fujitsu.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243520AbiFIOfF (ORCPT + 99 others); Thu, 9 Jun 2022 10:35:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57532 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235304AbiFIOfC (ORCPT ); Thu, 9 Jun 2022 10:35:02 -0400 Received: from heian.cn.fujitsu.com (mail.cn.fujitsu.com [183.91.158.132]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 373FA31CCB6; Thu, 9 Jun 2022 07:35:00 -0700 (PDT) IronPort-Data: =?us-ascii?q?A9a23=3A8KhIy6spCvB+FPZdJeO2fM3W+OfnVPhcMUV32f8?= =?us-ascii?q?akzHdYEJGY0x3y2oWDTuEa/aOYmWhctx/advi/U0PsJXQmoBnTldvr3tgHilAw?= =?us-ascii?q?SbnLY7Hdx+vZUt+DSFioHpPtpxYMp+ZRCwNZie0SiyFb/6x/RGQ6YnSHuCmULS?= =?us-ascii?q?cY3goLeNZYHxJZSxLyrdRbrFA0YDR7zOl4bsekuWHULOX82cc3lE8t8pvnChSU?= =?us-ascii?q?MHa41v0iLCRicdj5zcyn1FNZH4WyDrYw3HQGuG4FcbiLwrPIS3Qw4/Xw/stIov?= =?us-ascii?q?NfrfTeUtMTKPQPBSVlzxdXK3Kbhpq/3R0i/hkcqFHLxo/ZzahxridzP1XqJW2U?= =?us-ascii?q?hZvMKvXhMwTThtZDzpje6ZB/dcrJFDm65DDlhGZIyWEL/JGSRte0Zcj0up+H2B?= =?us-ascii?q?C3fICLzUKdBqCm6S9x7fTYulnhuwiKsfxNY8Ss30myivWZd4qQ4/ERari5tJC2?= =?us-ascii?q?jo0wMdUEp72YdQVaD9qRBDBeAFUfFMWDo8u2uulmBHXdzxetULQq7E77nbeyCR?= =?us-ascii?q?v37X3dtnYYNqHQYNShEnwjmbH+XnpRxIXLtqSzRKb/X+2wOzChyX2XMQVDrLQ3?= =?us-ascii?q?vprhkCDg3wdEzUIWlah5/q0kEizX5RYMUN8x8aEhcDe72TyFp+kAUL++yXC43Y?= =?us-ascii?q?htxNrO7VSwGmwJmD8um513lQ5cwM=3D?= IronPort-HdrOrdr: =?us-ascii?q?A9a23=3Av0Dwya3HDS+VGsXGsLDv+AqjBNwkLtp133Aq?= =?us-ascii?q?2lEZdPU1SK2lfq+V8MjzuSWetN9zYh8dcLK7V5VoKEm0naKdirN9AV7NZmPbhF?= =?us-ascii?q?c=3D?= X-IronPort-AV: E=Sophos;i="5.88,333,1635177600"; d="scan'208";a="124814786" Received: from unknown (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 09 Jun 2022 22:34:59 +0800 Received: from G08CNEXMBPEKD04.g08.fujitsu.local (unknown [10.167.33.201]) by cn.fujitsu.com (Postfix) with ESMTP id EF0F44D16FFC; Thu, 9 Jun 2022 22:34:57 +0800 (CST) Received: from G08CNEXCHPEKD07.g08.fujitsu.local (10.167.33.80) by G08CNEXMBPEKD04.g08.fujitsu.local (10.167.33.201) with Microsoft SMTP Server (TLS) id 15.0.1497.23; Thu, 9 Jun 2022 22:34:58 +0800 Received: from irides.mr.mr (10.167.225.141) by G08CNEXCHPEKD07.g08.fujitsu.local (10.167.33.209) with Microsoft SMTP Server id 15.0.1497.23 via Frontend Transport; Thu, 9 Jun 2022 22:34:37 +0800 From: Shiyang Ruan To: , , , CC: , , Subject: [PATCH] xfs: fail dax mount if reflink is enabled on a partition Date: Thu, 9 Jun 2022 22:34:35 +0800 Message-ID: <20220609143435.393724-1-ruansy.fnst@fujitsu.com> X-Mailer: git-send-email 2.36.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-yoursite-MailScanner-ID: EF0F44D16FFC.A55E3 X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: ruansy.fnst@fujitsu.com X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Failure notification is not supported on partitions. So, when we mount a reflink enabled xfs on a partition with dax option, let it fail with -EINVAL code. Signed-off-by: Shiyang Ruan --- fs/xfs/xfs_super.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c index 8495ef076ffc..a3c221841fa6 100644 --- a/fs/xfs/xfs_super.c +++ b/fs/xfs/xfs_super.c @@ -348,8 +348,10 @@ xfs_setup_dax_always( goto disable_dax; } - if (xfs_has_reflink(mp)) { - xfs_alert(mp, "DAX and reflink cannot be used together!"); + if (xfs_has_reflink(mp) && + bdev_is_partition(mp->m_ddev_targp->bt_bdev)) { + xfs_alert(mp, + "DAX and reflink cannot work with multi-partitions!"); return -EINVAL; } -- 2.36.1