Re: [PATCH v7 05/11] block: introduce blk_req_zone_write_trylock

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

 



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.



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux