Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1250709pxa; Thu, 20 Aug 2020 06:47:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwtKTfYt094J8IjgT6jlHc4THzzl7PPmylnPc/MDmTu8Vk+UTfHCaUfDnR6M68dVxdKjBpk X-Received: by 2002:a17:906:fa0b:: with SMTP id lo11mr3466456ejb.235.1597931227675; Thu, 20 Aug 2020 06:47:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597931227; cv=none; d=google.com; s=arc-20160816; b=Wi8WUPN4OCcB0tKkFCCOygunc41DDWy3ZC2/r0XPBlFYiTsKYrAt9s9ngIfoeY0vXk oSMsnRcsdFQsH3DH5Gfe62YClAdDDEKP+5MBTiPDR8jwCCiYploCry8FR+EbcdWFfr8q zV0GGXSxvvRII0KOgIouXDtr2hSxeIktzktgQWv2bMzZzsqyCMDsLpTHSx/1c9qRy1am BNHoUltDBzPE4nNVq6GdGF0/fA0YVFl49bY6wDQ83Tha+SyxvZ65JPkKc004JmWotSHg ceSLQt7w8E8Tqya3j1s/tVZ5Aw9JyM3EkiZIPWgyZNCFOxsjXXyLxmFNAOYmBrjuqTIa 8lcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=O0IZ969XNyCtVCpr4xG1KUqmRkSEVsz4+aV6WIMeNLo=; b=eWJCDjG2+JibXMnh12mGk8yAYX382IzxKmlfBc0MLMdJvA609HwiK2LMHym/Of6iI2 00q01F2NVJRbR4HrHIW3VFY+Uwga8CaHrtLWPHSfvWDSoZp6h33QbdP3Kf/p/wEB9fmL /bbcnZQ2XH+MnJiRCCfVPEA9M7teKeEypX9hL7OfQJl6xjAH0AeQI9HjaUZIMpNGvwqC fFlEVts3kXAAZzz0p3sLUSjxTMNUNCXn6Dm16dUvl1VbhOPRbDS+RqhHZAOU45TOb7Bd 3PcrojV0n3/3pxMtoS+qbAwpFgMxRar20jVjtUg9CH1PUc3UseMdmmr41cTbi4I0ddJU 2W8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=l7cD8eWe; 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=fail (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 j11si1399388edq.584.2020.08.20.06.46.42; Thu, 20 Aug 2020 06:47:07 -0700 (PDT) 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=@kernel.org header.s=default header.b=l7cD8eWe; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729062AbgHTNna (ORCPT + 99 others); Thu, 20 Aug 2020 09:43:30 -0400 Received: from mail.kernel.org ([198.145.29.99]:39982 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727873AbgHTJ33 (ORCPT ); Thu, 20 Aug 2020 05:29:29 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5BE4922CB1; Thu, 20 Aug 2020 09:29:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597915768; bh=WIKSys58th+7AjM3t2XfP0sozcAs5fjDqMdZLR227Zo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=l7cD8eWeIDK0BfKcK65tV0zDTuHKSdGVC4giS1YOYha0rTiwLSh+hAc18pTyUjRSR M7SuYe55UDlViWQS/YNXXqNll6GgWbf6TMwukgMm1N+gNtTr1RIvXqPNM3+CfIxXb4 vUGVmRJBNbA4H4j8SwCItYDdwuznxPbXfTenYGkY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, John Dorminy , Heinz Mauelshagen , Mike Snitzer Subject: [PATCH 5.8 098/232] dm ebs: Fix incorrect checking for REQ_OP_FLUSH Date: Thu, 20 Aug 2020 11:19:09 +0200 Message-Id: <20200820091617.578250486@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200820091612.692383444@linuxfoundation.org> References: <20200820091612.692383444@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: John Dorminy commit 4cb6f22612511ff2aba4c33fb0f281cae7c23772 upstream. REQ_OP_FLUSH was being treated as a flag, but the operation part of bio->bi_opf must be treated as a whole. Change to accessing the operation part via bio_op(bio) and checking for equality. Signed-off-by: John Dorminy Acked-by: Heinz Mauelshagen Fixes: d3c7b35c20d60 ("dm: add emulated block size target") Cc: stable@vger.kernel.org Signed-off-by: Mike Snitzer Signed-off-by: Greg Kroah-Hartman --- drivers/md/dm-ebs-target.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/md/dm-ebs-target.c +++ b/drivers/md/dm-ebs-target.c @@ -363,7 +363,7 @@ static int ebs_map(struct dm_target *ti, bio_set_dev(bio, ec->dev->bdev); bio->bi_iter.bi_sector = ec->start + dm_target_offset(ti, bio->bi_iter.bi_sector); - if (unlikely(bio->bi_opf & REQ_OP_FLUSH)) + if (unlikely(bio_op(bio) == REQ_OP_FLUSH)) return DM_MAPIO_REMAPPED; /* * Only queue for bufio processing in case of partial or overlapping buffers