All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Jens Axboe <axboe@fb.com>, Christoph Hellwig <hch@lst.de>,
	Mike Christie <mchristi@redhat.com>,
	Shaun Tancheff <shaun.tancheff@seagate.com>,
	Hannes Reinecke <hare@suse.com>,
	Johannes Thumshirn <jthumshirn@suse.de>,
	Bart Van Assche <bart.vanassche@sandisk.com>,
	Ming Lei <ming.lei@canonical.com>,
	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
Date: Thu, 10 Nov 2016 20:07:17 +0000	[thread overview]
Message-ID: <20161110200717.GA21893@lst.de> (raw)
In-Reply-To: <20161110200438.GA22854@mwanda>

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.

WARNING: multiple messages have this Message-ID (diff)
From: Christoph Hellwig <hch@lst.de>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Jens Axboe <axboe@fb.com>, Christoph Hellwig <hch@lst.de>,
	Mike Christie <mchristi@redhat.com>,
	Shaun Tancheff <shaun.tancheff@seagate.com>,
	Hannes Reinecke <hare@suse.com>,
	Johannes Thumshirn <jthumshirn@suse.de>,
	Bart Van Assche <bart.vanassche@sandisk.com>,
	Ming Lei <ming.lei@canonical.com>,
	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
Date: Thu, 10 Nov 2016 21:07:17 +0100	[thread overview]
Message-ID: <20161110200717.GA21893@lst.de> (raw)
In-Reply-To: <20161110200438.GA22854@mwanda>

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.

  reply	other threads:[~2016-11-10 20:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-10 20:04 [patch] block: precedence bug in bio_set_op_attrs() macro Dan Carpenter
2016-11-10 20:04 ` Dan Carpenter
2016-11-10 20:07 ` Christoph Hellwig [this message]
2016-11-10 20:07   ` Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161110200717.GA21893@lst.de \
    --to=hch@lst.de \
    --cc=axboe@fb.com \
    --cc=bart.vanassche@sandisk.com \
    --cc=dan.carpenter@oracle.com \
    --cc=hare@suse.com \
    --cc=jthumshirn@suse.de \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=mchristi@redhat.com \
    --cc=ming.lei@canonical.com \
    --cc=shaun.tancheff@seagate.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.