mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-04 17:57:54 -04:00
Merge tag 'for-linus-20190628' of git://git.kernel.dk/linux-block
Pull block fixes from Jens Axboe: "Just two small fixes. One from Paolo, fixing a silly mistake in BFQ. The other one is from me, ensuring that we have ->file cleared in the io_uring request a bit earlier. That avoids a use-before-free, if we encounter an error before ->file is assigned" * tag 'for-linus-20190628' of git://git.kernel.dk/linux-block: block, bfq: fix operator in BFQQ_TOTALLY_SEEKY io_uring: ensure req->file is cleared on allocation
This commit is contained in:
@@ -240,7 +240,7 @@ static struct kmem_cache *bfq_pool;
|
||||
* containing only random (seeky) I/O are prevented from being tagged
|
||||
* as soft real-time.
|
||||
*/
|
||||
#define BFQQ_TOTALLY_SEEKY(bfqq) (bfqq->seek_history & -1)
|
||||
#define BFQQ_TOTALLY_SEEKY(bfqq) (bfqq->seek_history == -1)
|
||||
|
||||
/* Min number of samples required to perform peak-rate update */
|
||||
#define BFQ_RATE_MIN_SAMPLES 32
|
||||
|
||||
@@ -579,6 +579,7 @@ static struct io_kiocb *io_get_req(struct io_ring_ctx *ctx,
|
||||
state->cur_req++;
|
||||
}
|
||||
|
||||
req->file = NULL;
|
||||
req->ctx = ctx;
|
||||
req->flags = 0;
|
||||
/* one is dropped after submission, the other at completion */
|
||||
@@ -1801,10 +1802,8 @@ static int io_req_set_file(struct io_ring_ctx *ctx, const struct sqe_submit *s,
|
||||
req->sequence = ctx->cached_sq_head - 1;
|
||||
}
|
||||
|
||||
if (!io_op_needs_file(s->sqe)) {
|
||||
req->file = NULL;
|
||||
if (!io_op_needs_file(s->sqe))
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (flags & IOSQE_FIXED_FILE) {
|
||||
if (unlikely(!ctx->user_files ||
|
||||
|
||||
Reference in New Issue
Block a user