Skip to content

Commit a76eef9

Browse files
fujitatorvalds
authored andcommitted
block/blk-map.c: use the new object_is_on_stack() helper
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Cc: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de> Cc: Tejun Heo <htejun@gmail.com> Cc: Jens Axboe <jens.axboe@oracle.com> Cc: James Bottomley <James.Bottomley@HansenPartnership.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent a2e2e35 commit a76eef9

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

‎block/blk-map.c‎

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,6 @@ int blk_rq_map_kern(struct request_queue *q, struct request *rq, void *kbuf,
269269
int reading = rq_data_dir(rq) == READ;
270270
int do_copy = 0;
271271
struct bio *bio;
272-
unsigned long stack_mask = ~(THREAD_SIZE - 1);
273272

274273
if (len > (q->max_hw_sectors << 9))
275274
return -EINVAL;
@@ -278,11 +277,8 @@ int blk_rq_map_kern(struct request_queue *q, struct request *rq, void *kbuf,
278277

279278
kaddr = (unsigned long)kbuf;
280279
alignment = queue_dma_alignment(q) | q->dma_pad_mask;
281-
do_copy = ((kaddr & alignment) || (len & alignment));
282-
283-
if (!((kaddr & stack_mask) ^
284-
((unsigned long)current->stack & stack_mask)))
285-
do_copy = 1;
280+
do_copy = ((kaddr & alignment) || (len & alignment) ||
281+
object_is_on_stack(kbuf));
286282

287283
if (do_copy)
288284
bio = bio_copy_kern(q, kbuf, len, gfp_mask, reading);

0 commit comments

Comments
 (0)