Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bugfix] Misusing variable leads to kernel panic on cloning io request. #24

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 7 additions & 10 deletions infiniswap_bd/is_mq.c
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,6 @@ void stackbd_make_request2(struct request_queue *q, struct request *req)
{
struct bio *bio = NULL;
struct bio *b = req->bio;
int i;
int len = req->nr_phys_segments;

spin_lock_irq(&stackbd.lock);
if (!stackbd.bdev_raw)
Expand All @@ -230,15 +228,14 @@ void stackbd_make_request2(struct request_queue *q, struct request *req)
printk("stackbd: Device not active yet, aborting\n");
goto abort;
}
for (i=0; i<len -1; i++){
bio = bio_clone(b, GFP_ATOMIC);
bio_list_add(&stackbd.bio_list, bio);
b = b->bi_next;

for (; b; b = b->bi_next)
{
bio = bio_clone(b, GFP_ATOMIC);
bio->bi_end_io = (bio_end_io_t*)IS_stackbd_end_io;
bio->bi_private = (void*) uint64_from_ptr(req);
bio_list_add(&stackbd.bio_list, bio);
}
bio = bio_clone(b, GFP_ATOMIC);
bio->bi_end_io = (bio_end_io_t*)IS_stackbd_end_io;
bio->bi_private = (void*) uint64_from_ptr(req);
bio_list_add(&stackbd.bio_list, bio);

wake_up(&req_event);
spin_unlock_irq(&stackbd.lock);
Expand Down