dm-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Bart Van Assche <bart.vanassche@sandisk.com>
Cc: Jens Axboe <axboe@fb.com>, Mike Christie <mchristi@redhat.com>,
	Chris Mason <clm@fb.com>, Josef Bacik <jbacik@fb.com>,
	Mike Snitzer <snitzer@redhat.com>, Christoph Hellwig <hch@lst.de>,
	Hannes Reinecke <hare@suse.de>,
	Damien Le Moal <Damien.LeMoal@hgst.com>,
	"linux-block@vger.kernel.org" <linux-block@vger.kernel.org>,
	"linux-btrfs@vger.kernel.org" <linux-btrfs@vger.kernel.org>,
	device-mapper development <dm-devel@redhat.com>
Subject: Re: [PATCH 2/3] block, dm-crypt, btrfs: Introduce bio_flags()
Date: Wed, 14 Sep 2016 11:58:14 +0200	[thread overview]
Message-ID: <20160914095814.GB21938@lst.de> (raw)
In-Reply-To: <144083a3-2d0a-00ff-add2-a2f6f3690528@sandisk.com>

On Wed, Sep 14, 2016 at 10:45:36AM +0200, Bart Van Assche wrote:
> Introduce the bio_flags() macro. Ensure that the second argument of
> bio_set_op_attrs() only contains flags and no operation. This patch
> does not change any functionality.
> 
> Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
> Cc: Mike Christie <mchristi@redhat.com>
> Cc: Chris Mason <clm@fb.com> (maintainer:BTRFS FILE SYSTEM)
> Cc: Josef Bacik <jbacik@fb.com> (maintainer:BTRFS FILE SYSTEM)
> Cc: Mike Snitzer <snitzer@redhat.com>
> Cc: Christoph Hellwig <hch@lst.de>
> Cc: Hannes Reinecke <hare@suse.de>
> Cc: Damien Le Moal <damien.lemoal@hgst.com>
> ---
>  drivers/md/dm-crypt.c     | 2 +-
>  fs/btrfs/inode.c          | 5 +++--
>  include/linux/blk_types.h | 3 ++-
>  3 files changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c
> index 8742957..0448e7e 100644
> --- a/drivers/md/dm-crypt.c
> +++ b/drivers/md/dm-crypt.c
> @@ -1136,7 +1136,7 @@ static void clone_init(struct dm_crypt_io *io, struct bio *clone)
>  	clone->bi_private = io;
>  	clone->bi_end_io  = crypt_endio;
>  	clone->bi_bdev    = cc->dev->bdev;
> -	bio_set_op_attrs(clone, bio_op(io->base_bio), io->base_bio->bi_opf);
> +	bio_set_op_attrs(clone, bio_op(io->base_bio), bio_flags(io->base_bio));

Given that bio_set_op_attrs calls bio_flags internall do we need
the call here as well?

The other option might be to check that we only get flags inside the
bio_flags space and let the caller sort it out, which sounds useful
to me.

  parent reply	other threads:[~2016-09-14  9:58 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-14  8:42 [PATCH 0/3] block: Improve bio_set_op_attrs() robustness Bart Van Assche
2016-09-14  8:44 ` [PATCH 1/3] block: Document that bio_op() uses the data type of bio.bi_opf Bart Van Assche
2016-09-14  8:52   ` Johannes Thumshirn
2016-09-14  9:56   ` Christoph Hellwig
2016-09-14  8:45 ` [PATCH 2/3] block, dm-crypt, btrfs: Introduce bio_flags() Bart Van Assche
2016-09-14  8:53   ` Johannes Thumshirn
2016-09-14  9:58   ` Christoph Hellwig [this message]
2016-09-14  9:59   ` Christoph Hellwig
2016-09-14  8:46 ` [PATCH 3/3] block: Improve bio_set_op_attrs() robustness Bart Van Assche
2016-09-14  8:55   ` Johannes Thumshirn
2016-09-14  9:59   ` Christoph Hellwig
2016-09-14 14:48 ` [PATCH 0/3] " Jens Axboe

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=20160914095814.GB21938@lst.de \
    --to=hch@lst.de \
    --cc=Damien.LeMoal@hgst.com \
    --cc=axboe@fb.com \
    --cc=bart.vanassche@sandisk.com \
    --cc=clm@fb.com \
    --cc=dm-devel@redhat.com \
    --cc=hare@suse.de \
    --cc=jbacik@fb.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=mchristi@redhat.com \
    --cc=snitzer@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).