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

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

 



On 6/28/20 5:43 AM, Bart Van Assche wrote:
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()?

Depends on the frequency, but yeah, we could.

  #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?

Possibly, but that would be a different patchset.
I'd rather not introduce it here as it would convolute this patchset even more.

Cheers,

Hannes
--
Dr. Hannes Reinecke            Teamlead Storage & Networking
hare@xxxxxxx                               +49 911 74053 688
SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409 Nürnberg
HRB 36809 (AG Nürnberg), Geschäftsführer: Felix Imendörffer



[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