Re: [PATCH 02/22] block: add flag for internal commands

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

 



On 2020-06-25 07:01, Hannes Reinecke wrote:
> diff --git a/block/blk-exec.c b/block/blk-exec.c
> index 85324d53d072..86e8968cfa90 100644
> --- a/block/blk-exec.c
> +++ b/block/blk-exec.c
> @@ -55,6 +55,11 @@ void blk_execute_rq_nowait(struct request_queue *q, struct gendisk *bd_disk,
>  	rq->rq_disk = bd_disk;
>  	rq->end_io = done;
>  
> +	if (WARN_ON(blk_rq_is_internal(rq))) {
> +		blk_mq_end_request(rq, BLK_STS_NOTSUPP);
> +		return;
> +	}
> +
>  	blk_account_io_start(rq);

Isn't it recommended to use WARN_ON_ONCE() instead of WARN_ON()?

>  #define REQ_DRV			(1ULL << __REQ_DRV)
>  #define REQ_SWAP		(1ULL << __REQ_SWAP)
> +#define REQ_INTERNAL		(1ULL << __REQ_INTERNAL)

How about introducing a __bitwise type for the REQ_ flags such that
sparse can check whether the proper type of flags has been passed to a
function?

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