From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from verein.lst.de ([213.95.11.211]:41096 "EHLO newverein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965893AbcKJUHU (ORCPT ); Thu, 10 Nov 2016 15:07:20 -0500 Date: Thu, 10 Nov 2016 21:07:17 +0100 From: Christoph Hellwig To: Dan Carpenter Cc: Jens Axboe , Christoph Hellwig , Mike Christie , Shaun Tancheff , Hannes Reinecke , Johannes Thumshirn , Bart Van Assche , Ming Lei , linux-block@vger.kernel.org, linux-btrfs@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: Re: [patch] block: precedence bug in bio_set_op_attrs() macro Message-ID: <20161110200717.GA21893@lst.de> References: <20161110200438.GA22854@mwanda> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: <20161110200438.GA22854@mwanda> Sender: linux-btrfs-owner@vger.kernel.org List-ID: On Thu, Nov 10, 2016 at 11:04:38PM +0300, Dan Carpenter wrote: > This code causes a problem for flush_epd_write_bio() because | has > higher precedence than ?: so it basically turns into: > > ((bio)->bi_opf |= REQ_SYNC; > > Which is wrong. Its is. And while we're at it the macro should really be doing a = instead of |=. And we really should stop using it, at least in the block core even ASAP.