Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp244764pxf; Wed, 10 Mar 2021 05:32:47 -0800 (PST) X-Google-Smtp-Source: ABdhPJz4j6kNxEx6eS7kxr/SmBeCi4UNXaHqd/GNfzeCZHDFUOwVsNfDl98rIqYzymKhuR4yzmjZ X-Received: by 2002:a17:906:ecfb:: with SMTP id qt27mr3562838ejb.245.1615383167262; Wed, 10 Mar 2021 05:32:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615383167; cv=none; d=google.com; s=arc-20160816; b=nIJaz5lsLcYzQqGP6ITAU8yCr8+fl4QQGKHKuENeQzcFFoCVX9FvgDU5x8CDgdxScU EDXNgObQpCI9AXmMQAL+e74LzKeGjihjL3K3+pKG9kndq5r+AWd8Juve/F5u9QJkq8gt yBPr1bhuQWXubIJZmjKlnABNb2P1SH5VxBIVXiugQwbayqCJtE3E6vYhI9/i0epf/mkC kKRCK3DP643EXM4NqZQYVvbOwNNN0XGfamYmVWsrxRUUDPoCgAmTVVEvS0yqUCveZgcg DLCN1EE8dfHQkm+pmB/FY333M+FKDHPnPmME3jrJs/12tU5Ua0RQ61aTHH24PaGNnHwl 4woQ== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=GKxrcZ4swD/pD63H0uuGWrYnyEiv8amHGrUr1lEuW5w=; b=SykypNa48mBCXY4JE2L7zfJFHjphVE83XKkE9APyurqq9Pk5r8tHWdS0q1xYbEOmIp /RdEtOFc05vXeVckfUx8X7iOgaQsO3aT8LnUHLQ9eUw5b2PWg2XDlRfoEqcSyNts4WmB jFkGjzodxVyrD9h+C/43tsngKcIWH1eS0t9ePS6skYhU/MTE8sjL7fKglCjVyBOVGlOU ElWAZQV5CFnfsECzBqk/1em7FDIRnB5tjdVrIgalV/pfaEKmj/gzKFyf+E87yCXiqlxV P++Dq9aRW5i8caKDM4o1rhXnq8mRkBvuzrMnfLiJzzGP41hu/Z4TmjWN5ttB4GivXRrS 1RDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=qRJoMH+p; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z21si10965357edx.208.2021.03.10.05.32.20; Wed, 10 Mar 2021 05:32:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=qRJoMH+p; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232714AbhCJN30 (ORCPT + 99 others); Wed, 10 Mar 2021 08:29:26 -0500 Received: from mail.kernel.org ([198.145.29.99]:47832 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233381AbhCJNZb (ORCPT ); Wed, 10 Mar 2021 08:25:31 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 03BF26501A; Wed, 10 Mar 2021 13:25:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615382727; bh=WWPU+F5imDjC+GV73x5lDGmRwV97hDoUeYXijxdR4sw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qRJoMH+p/wUpdsOBqV5qN5Ud5KVyhgYqHi8WwbdmmMMk/lH0OAVDNDfuu/RJjjQTu AihbAfK3acLvAKJsTvz7q9IepgvMA/7tNx4EnTeijJ48QEVVN6aKj6k5f2G9rkCWNE uNyyEl26Oq3fBcy5tkzdLOeXtgDPHphF535LVlBM= From: gregkh@linuxfoundation.org To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jeffle Xu , Mike Snitzer Subject: [PATCH 4.9 07/11] dm table: fix DAX iterate_devices based device capability checks Date: Wed, 10 Mar 2021 14:25:06 +0100 Message-Id: <20210310132320.632132455@linuxfoundation.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210310132320.393957501@linuxfoundation.org> References: <20210310132320.393957501@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Greg Kroah-Hartman From: Jeffle Xu commit 5b0fab508992c2e120971da658ce80027acbc405 upstream. Fix dm_table_supports_dax() and invert logic of both iterate_devices_callout_fn so that all devices' DAX capabilities are properly checked. Fixes: 545ed20e6df6 ("dm: add infrastructure for DAX support") Cc: stable@vger.kernel.org Signed-off-by: Jeffle Xu Signed-off-by: Mike Snitzer [jeffle: no dax write cache, no dax synchronous] Signed-off-by: Greg Kroah-Hartman --- drivers/md/dm-table.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) --- a/drivers/md/dm-table.c +++ b/drivers/md/dm-table.c @@ -848,12 +848,12 @@ void dm_table_set_type(struct dm_table * } EXPORT_SYMBOL_GPL(dm_table_set_type); -static int device_supports_dax(struct dm_target *ti, struct dm_dev *dev, - sector_t start, sector_t len, void *data) +static int device_not_dax_capable(struct dm_target *ti, struct dm_dev *dev, + sector_t start, sector_t len, void *data) { struct request_queue *q = bdev_get_queue(dev->bdev); - return q && blk_queue_dax(q); + return q && !blk_queue_dax(q); } static bool dm_table_supports_dax(struct dm_table *t) @@ -869,7 +869,7 @@ static bool dm_table_supports_dax(struct return false; if (!ti->type->iterate_devices || - !ti->type->iterate_devices(ti, device_supports_dax, NULL)) + ti->type->iterate_devices(ti, device_not_dax_capable, NULL)) return false; }