From patchwork Fri Jul 31 22:46:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Dorminy X-Patchwork-Id: 11697715 X-Patchwork-Delegate: snitzer@redhat.com 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 5458413B1 for ; Mon, 3 Aug 2020 09:25:21 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0CDDB2065C for ; Mon, 3 Aug 2020 09:25:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="bWR2Idss" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0CDDB2065C Authentication-Results: mail.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dm-devel-bounces@redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1596446720; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=gVMjMI/DNQVVaRRts9Uo8EHlfKbA5MGCaAmhwol4TG4=; b=bWR2Idss+G5gwz6Gp+rlAECvqkIvSRpxVPedX6g1hVP9f52rGZ4LYuUP+ItVMaFAKYzlv5 orMSikU+ez66OFb3XmS6fECAStWLBZZ9cZjqwXTZnnFiV5kIMBBi38Csgy7Ag/eZtj1ta7 WeF/5p5Ur1ymYR0CGXHzGvDrKSKqxJ4= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-233-Cgy9zvlcOMiN8Tk7HZZf2A-1; Mon, 03 Aug 2020 05:25:16 -0400 X-MC-Unique: Cgy9zvlcOMiN8Tk7HZZf2A-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 365B718C63C6; Mon, 3 Aug 2020 09:25:10 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C2AB75DA33; Mon, 3 Aug 2020 09:25:08 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 03C351809554; Mon, 3 Aug 2020 09:25:05 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 06VMkw0K031826 for ; Fri, 31 Jul 2020 18:46:58 -0400 Received: by smtp.corp.redhat.com (Postfix) id 31B6B1D3; Fri, 31 Jul 2020 22:46:58 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from localhost.localdomain.com (ovpn-112-36.rdu2.redhat.com [10.10.112.36]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1069D5C22A; Fri, 31 Jul 2020 22:46:48 +0000 (UTC) From: John Dorminy To: Alasdair Kergon , Mike Snitzer , dm-devel@redhat.com Date: Fri, 31 Jul 2020 18:46:45 -0400 Message-Id: <20200731224645.89483-1-jdorminy@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: dm-devel@redhat.com X-Mailman-Approved-At: Mon, 03 Aug 2020 05:22:05 -0400 Cc: John Dorminy Subject: [dm-devel] [PATCH] dm-ebs: Fix incorrect checking for REQ_OP_FLUSH. X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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 --- drivers/md/dm-ebs-target.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/md/dm-ebs-target.c b/drivers/md/dm-ebs-target.c index 44451276f128..cb85610527c2 100644 --- 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, struct bio *bio) 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