From patchwork Mon Jun 25 22:51:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 10487491 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 249AC603B5 for ; Mon, 25 Jun 2018 22:51:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1792828707 for ; Mon, 25 Jun 2018 22:51:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0C0892870B; Mon, 25 Jun 2018 22:51:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9108C28707 for ; Mon, 25 Jun 2018 22:51:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754278AbeFYWvc (ORCPT ); Mon, 25 Jun 2018 18:51:32 -0400 Received: from esa3.hgst.iphmx.com ([216.71.153.141]:5235 "EHLO esa3.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754204AbeFYWvb (ORCPT ); Mon, 25 Jun 2018 18:51:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1529967091; x=1561503091; h=from:to:cc:subject:date:message-id; bh=gg+4FlvmJVRdxNf8gHTfhrblUL5c2VsNcOefL8Jxd58=; b=bGY5E33EzvhGpnlRDIUnIUY2Vq8r0LoUll73GcMmY9kTogOmZTpWqBTj ZFg0re6Cde/GfoBQn7kBgUp/B+ZWJjlFyICrpI7onhih8ui9UAF8kyNy5 1iAHD4FdEjjNMDefY+SIUYz5Rl4DqbApXXsJ7wlKNUwtcN5zkF9K91tad Yvn2li9avFQt3U64wyd6LQ3i4S+aZ82W13kJfpTAIvG790SHyH3FdII6Y qVrYwyJKhxT8S5IyJv7djrfRC7S001jIDisuTl3SeMX9CpOH9Sl439TSt h2TfeC4/BP2vcMcGOkBQz0nXrx7vXIaTEbKJx78Qg6cgoAevLif7JFR3g w==; X-IronPort-AV: E=Sophos;i="5.51,272,1526313600"; d="scan'208";a="84342528" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 26 Jun 2018 06:51:31 +0800 Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP; 25 Jun 2018 15:41:06 -0700 Received: from thinkpad-bart.sdcorp.global.sandisk.com ([10.111.67.248]) by uls-op-cesaip02.wdc.com with ESMTP; 25 Jun 2018 15:51:31 -0700 From: Bart Van Assche To: Jens Axboe Cc: linux-block@vger.kernel.org, Christoph Hellwig , Bart Van Assche , Philipp Reisner , Lars Ellenberg Subject: [PATCH] drbd: Fix drbd_request_prepare() discard handling Date: Mon, 25 Jun 2018 15:51:30 -0700 Message-Id: <20180625225130.4447-1-bart.vanassche@wdc.com> X-Mailer: git-send-email 2.17.1 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Fix the test that verifies whether bio_op(bio) represents a discard or write zeroes operation. Compile-tested only. Fixes: 7435e9018f91 ("drbd: zero-out partial unaligned discards on local backend") Signed-off-by: Bart Van Assche Cc: Philipp Reisner Cc: Lars Ellenberg Reviewed-by: Christoph Hellwig --- drivers/block/drbd/drbd_req.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/block/drbd/drbd_req.c b/drivers/block/drbd/drbd_req.c index 24f0884ec01f..a8e7d7318e37 100644 --- a/drivers/block/drbd/drbd_req.c +++ b/drivers/block/drbd/drbd_req.c @@ -1244,8 +1244,8 @@ drbd_request_prepare(struct drbd_device *device, struct bio *bio, unsigned long _drbd_start_io_acct(device, req); /* process discards always from our submitter thread */ - if ((bio_op(bio) & REQ_OP_WRITE_ZEROES) || - (bio_op(bio) & REQ_OP_DISCARD)) + if (bio_op(bio) == REQ_OP_WRITE_ZEROES || + bio_op(bio) == REQ_OP_DISCARD) goto queue_for_submitter_thread; if (rw == WRITE && req->private_bio && req->i.size