Commit cdd60262 authored by Jens Axboe's avatar Jens Axboe Committed by Jens Axboe
Browse files

[PATCH] Remove ->rq_status from struct request



After Christophs SCSI change, the only usage left is RQ_ACTIVE
and RQ_INACTIVE. The block layer sets RQ_INACTIVE right before freeing
the request, so any check for RQ_INACTIVE in a driver is a bug and
indicates use-after-free.

So kill/clean the remaining users, straight forward.

Signed-off-by: default avatarJens Axboe <axboe@suse.de>
parent 49171e5c
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -981,8 +981,6 @@ static int prepare_request(struct request *req, struct io_thread_req *io_req)
	__u64 offset;
	int len;

	if(req->rq_status == RQ_INACTIVE) return(1);

	/* This should be impossible now */
	if((rq_data_dir(req) == WRITE) && !dev->openflags.w){
		printk("Write attempted on readonly ubd device %s\n",
+0 −3
Original line number Diff line number Diff line
@@ -283,7 +283,6 @@ static inline void rq_init(request_queue_t *q, struct request *rq)
	INIT_LIST_HEAD(&rq->donelist);

	rq->errors = 0;
	rq->rq_status = RQ_ACTIVE;
	rq->bio = rq->biotail = NULL;
	INIT_HLIST_NODE(&rq->hash);
	RB_CLEAR_NODE(&rq->rb_node);
@@ -2685,8 +2684,6 @@ void __blk_put_request(request_queue_t *q, struct request *req)

	elv_completed_request(q, req);

	req->rq_status = RQ_INACTIVE;

	/*
	 * Request may not have originated from ll_rw_blk. if not,
	 * it didn't come out of our reserved rq pools
+0 −1
Original line number Diff line number Diff line
@@ -719,7 +719,6 @@ static int pd_special_command(struct pd_unit *disk,

	memset(&rq, 0, sizeof(rq));
	rq.errors = 0;
	rq.rq_status = RQ_ACTIVE;
	rq.rq_disk = disk->gd;
	rq.ref_count = 1;
	rq.end_io_data = &wait;
+2 −2
Original line number Diff line number Diff line
@@ -319,8 +319,8 @@ static void start_request(struct floppy_state *fs)
		printk("do_fd_req: dev=%s cmd=%d sec=%ld nr_sec=%ld buf=%p\n",
		       req->rq_disk->disk_name, req->cmd,
		       (long)req->sector, req->nr_sectors, req->buffer);
		printk("           rq_status=%d errors=%d current_nr_sectors=%ld\n",
		       req->rq_status, req->errors, req->current_nr_sectors);
		printk("           errors=%d current_nr_sectors=%ld\n",
		       req->errors, req->current_nr_sectors);
#endif

		if (req->sector < 0 || req->sector >= fs->total_secs) {
+2 −2
Original line number Diff line number Diff line
@@ -529,8 +529,8 @@ static void start_request(struct floppy_state *fs)
		printk("do_fd_req: dev=%s cmd=%d sec=%ld nr_sec=%ld buf=%p\n",
		       CURRENT->rq_disk->disk_name, CURRENT->cmd,
		       CURRENT->sector, CURRENT->nr_sectors, CURRENT->buffer);
		printk("           rq_status=%d errors=%d current_nr_sectors=%ld\n",
		       CURRENT->rq_status, CURRENT->errors, CURRENT->current_nr_sectors);
		printk("           errors=%d current_nr_sectors=%ld\n",
		      CURRENT->errors, CURRENT->current_nr_sectors);
#endif

		if (CURRENT->sector < 0 || CURRENT->sector >= fs->total_secs) {
Loading