On 2020-04-17 05:15, Johannes Thumshirn wrote: > +bool blk_req_zone_write_trylock(struct request *rq) > +{ > + unsigned int zno = blk_rq_zone_no(rq); > + > + if (test_and_set_bit(zno, rq->q->seq_zones_wlock)) > + return false; > + > + WARN_ON_ONCE(rq->rq_flags & RQF_ZONE_WRITE_LOCKED); > + rq->rq_flags |= RQF_ZONE_WRITE_LOCKED; > + > + return true; > +} > +EXPORT_SYMBOL_GPL(blk_req_zone_write_trylock); Although different requests can be processed concurrently by the block layer, all processing steps for an individual request happen sequentially. So I think it is safe to move the WARN_ON_ONCE(rq->rq_flags & RQF_ZONE_WRITE_LOCKED) above the test_and_set_bit() call. Thanks, Bart.