From: Bart Van Assche <bvanassche@acm.org>
To: Ashlie Martinez <ashmrtn@utexas.edu>
Cc: linux-block@vger.kernel.org
Subject: Re: RFC bio flags and ops in v4.10+
Date: Tue, 22 Jan 2019 09:05:54 -0800 [thread overview]
Message-ID: <1548176754.9266.50.camel@acm.org> (raw)
In-Reply-To: <CAFk8rvaNjaDYddBGmgwAir4S-JkkR__9MhSv3Ep7hQA3-YFkCg@mail.gmail.com>
On Mon, 2019-01-21 at 21:12 -0800, Ashlie Martinez wrote:
> On Mon, Jan 21, 2019 at 9:04 PM Bart Van Assche <bvanassche@acm.org> wrote:
> >
> > On 1/21/19 8:45 PM, Ashlie Martinez wrote:
> > > I was working on porting parts of a file system crash consistency
> > > checking tool called CrashMonkey [1] to linux kernels 4.9 and 4.14
> > > when I noticed an inconsistency in how the bio->bi_opf field is
> > > treated. According to the comments in /include/linux/blk_types.h, the
> > > REQ_OP should be the upper bits in bi_opf, while the request flags
> > > should be in the lower bits. In kernel 4.9, the accessor and setter
> > > methods for this field appear to be correct. However, kernels 4.10+ do
> > > not properly shift the REQ_OP argument up for either setting it or
> > > getting it from bi_opf. Is this the intended behavior or is it a
> > > mistake in how the code was written? Please note that I have not
> > > checked all the releases between 4.9 and 5.0-rc3, but I know 4.10,
> > > 4.14, 4.15, and 5.0-rc3 contain the same or similar code for setting
> > > bio->bi_opf.
> >
> > Hi Ashlie,
> >
> > Are you perhaps referring to commit ef295ecf090d ("block: better op and
> > flags encoding")? Have you noticed that that commit modified the
> > encoding such that the operation ends up in the lower 8 bits and the
> > flags in the upper 24 bits? That patch namely includes the following change:
> >
> > +enum req_flag_bits {
> > + __REQ_FAILFAST_DEV = /* no driver retries of device errors */
> > + REQ_OP_BITS,
> >
>
> Ah, I missed that assignment hiding on the next line (possibly because
> I've been staring at the code for various projects for too long :) ),
> thanks for pointing it out for me! One (minor) nit about the current
> code then: it appears that the comment on bio->bi_opf still refers to
> the old arrangement where the REQ_OP occupied the upper bits of the
> field, making it hard to figure out what's happening at a glance
If you would like to submit a patch that updates the header file comments,
I think it would be welcome :-)
Bart.
prev parent reply other threads:[~2019-01-22 17:05 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-22 4:45 RFC bio flags and ops in v4.10+ Ashlie Martinez
2019-01-22 5:04 ` Bart Van Assche
2019-01-22 5:12 ` Ashlie Martinez
2019-01-22 17:05 ` Bart Van Assche [this message]
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=1548176754.9266.50.camel@acm.org \
--to=bvanassche@acm.org \
--cc=ashmrtn@utexas.edu \
--cc=linux-block@vger.kernel.org \
/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).