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.



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux