From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753667AbdJMDpW (ORCPT ); Thu, 12 Oct 2017 23:45:22 -0400 Received: from regular1.263xmail.com ([211.150.99.132]:36997 "EHLO regular1.263xmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753421AbdJMDpU (ORCPT ); Thu, 12 Oct 2017 23:45:20 -0400 X-263anti-spam: KSV:0; X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-KSVirus-check: 0 X-ABS-CHECKED: 4 X-RL-SENDER: jeffy.chen@rock-chips.com X-FST-TO: linux-kernel@vger.kernel.org X-SENDER-IP: 103.29.142.67 X-LOGIN-NAME: jeffy.chen@rock-chips.com X-UNIQUE-TAG: <6fb1041108aa088410b9d004c98e8a3c> X-ATTACHMENT-NUM: 0 X-DNS-TYPE: 0 From: Jeffy Chen To: linux-kernel@vger.kernel.org, axboe@fb.com, hch@lst.de Cc: Jeffy Chen , Shaun Tancheff , "Martin K. Petersen" , NeilBrown , Jens Axboe , Shaohua Li , Omar Sandoval Subject: [PATCH v2 1/2] block: Treat all read ops as synchronous Date: Fri, 13 Oct 2017 11:45:06 +0800 Message-Id: <20171013034507.30823-1-jeffy.chen@rock-chips.com> X-Mailer: git-send-email 2.11.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The comment for op_is_sync() says "Reads are always treated as synchronous", but it only checks for REQ_OP_READ. Use op_is_write() to detect read ops and treat them as synchronous. Fixes: aebf526b53ae ("block: fold cmd_type into the REQ_OP_ space") Signed-off-by: Jeffy Chen --- Changes in v2: Rewrite commit message. include/linux/blk_types.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h index 3385c89f402e..b6a71c2eec36 100644 --- a/include/linux/blk_types.h +++ b/include/linux/blk_types.h @@ -288,8 +288,7 @@ static inline bool op_is_flush(unsigned int op) */ static inline bool op_is_sync(unsigned int op) { - return (op & REQ_OP_MASK) == REQ_OP_READ || - (op & (REQ_SYNC | REQ_FUA | REQ_PREFLUSH)); + return !op_is_write(op) || (op & (REQ_SYNC | REQ_FUA | REQ_PREFLUSH)); } typedef unsigned int blk_qc_t; -- 2.11.0