Re: [PATCH] block: Set req quiet flag if bio is quiet

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, 2020-06-27 at 16:00 +0800, Ming Lei wrote:
> On Sat, Jun 27, 2020 at 2:12 AM Aleksei Marov <alekseymmm@xxxxxxx>
> wrote:
> > The current behavior is that if bio flagged as BIO_QUIETis
> > submitted to request based block device then the request
> > that wraps this bio in a queue is not quiet. RQF_FLAG is not
> > set anywhere. Hence, if errors happen we can see error
> > messages (e.g. in print_req_error) even though bio is quiet.
> > This patch fixes that by setting the flag in blk_rq_bio_prep.
> > 
> > Signed-off-by: Aleksei Marov <alekseymmm@xxxxxxx>
> > ---
> >  block/blk.h | 3 +++
> >  1 file changed, 3 insertions(+)
> > 
> > diff --git a/block/blk.h b/block/blk.h
> > index b5d1f0f..04ca4e0 100644
> > --- a/block/blk.h
> > +++ b/block/blk.h
> > @@ -108,6 +108,9 @@ static inline void blk_rq_bio_prep(struct
> > request
> > *rq, struct bio *bio,
> > 
> >         if (bio->bi_disk)
> >                 rq->rq_disk = bio->bi_disk;
> > +
> > +       if (bio_flagged(bio, BIO_QUIET))
> > +               rq->rq_flags |= RQF_QUIET;
> >  }
> 
> BIO_QUIET consumer is fs code, and RQF_QUIET consumer is block layer,
> so you think
> the two consumers' expectation is same?
> 
Hi Ming Lei, thanks for your comment, I appreciate it since it is the
first time I send a patch to the kernel. Regarding your point, it makes
sense to me that the two consumers' expectations are the same. Correct
me if I am wrong. I never found a good explanation of this relationship
between bio and req of lower devices.  Maybe this "quiet" behavior is
not important or very rare.
Besides, I think that not only fs works with bio, but some bio could be
allocated and handled entirely within the block layer, e.g. in stacked
block devices like mdraid, may be lvm.




[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux