diff options
-rw-r--r-- | drivers/block/xsysace.c | 22 | ||||
-rw-r--r-- | fs/bio-integrity.c | 5 | ||||
-rw-r--r-- | fs/bio.c | 6 | ||||
-rw-r--r-- | include/linux/bio.h | 4 |
4 files changed, 31 insertions, 6 deletions
diff --git a/drivers/block/xsysace.c b/drivers/block/xsysace.c index 381d686fc1a3..119be3442f28 100644 --- a/drivers/block/xsysace.c +++ b/drivers/block/xsysace.c | |||
@@ -489,6 +489,28 @@ static void ace_fsm_dostate(struct ace_device *ace) | |||
489 | ace->fsm_state, ace->id_req_count); | 489 | ace->fsm_state, ace->id_req_count); |
490 | #endif | 490 | #endif |
491 | 491 | ||
492 | /* Verify that there is actually a CF in the slot. If not, then | ||
493 | * bail out back to the idle state and wake up all the waiters */ | ||
494 | status = ace_in32(ace, ACE_STATUS); | ||
495 | if ((status & ACE_STATUS_CFDETECT) == 0) { | ||
496 | ace->fsm_state = ACE_FSM_STATE_IDLE; | ||
497 | ace->media_change = 1; | ||
498 | set_capacity(ace->gd, 0); | ||
499 | dev_info(ace->dev, "No CF in slot\n"); | ||
500 | |||
501 | /* Drop all pending requests */ | ||
502 | while ((req = elv_next_request(ace->queue)) != NULL) | ||
503 | end_request(req, 0); | ||
504 | |||
505 | /* Drop back to IDLE state and notify waiters */ | ||
506 | ace->fsm_state = ACE_FSM_STATE_IDLE; | ||
507 | ace->id_result = -EIO; | ||
508 | while (ace->id_req_count) { | ||
509 | complete(&ace->id_completion); | ||
510 | ace->id_req_count--; | ||
511 | } | ||
512 | } | ||
513 | |||
492 | switch (ace->fsm_state) { | 514 | switch (ace->fsm_state) { |
493 | case ACE_FSM_STATE_IDLE: | 515 | case ACE_FSM_STATE_IDLE: |
494 | /* See if there is anything to do */ | 516 | /* See if there is anything to do */ |
diff --git a/fs/bio-integrity.c b/fs/bio-integrity.c index 549b0144da11..fe2b1aa2464e 100644 --- a/fs/bio-integrity.c +++ b/fs/bio-integrity.c | |||
@@ -685,19 +685,20 @@ EXPORT_SYMBOL(bio_integrity_split); | |||
685 | * bio_integrity_clone - Callback for cloning bios with integrity metadata | 685 | * bio_integrity_clone - Callback for cloning bios with integrity metadata |
686 | * @bio: New bio | 686 | * @bio: New bio |
687 | * @bio_src: Original bio | 687 | * @bio_src: Original bio |
688 | * @gfp_mask: Memory allocation mask | ||
688 | * @bs: bio_set to allocate bip from | 689 | * @bs: bio_set to allocate bip from |
689 | * | 690 | * |
690 | * Description: Called to allocate a bip when cloning a bio | 691 | * Description: Called to allocate a bip when cloning a bio |
691 | */ | 692 | */ |
692 | int bio_integrity_clone(struct bio *bio, struct bio *bio_src, | 693 | int bio_integrity_clone(struct bio *bio, struct bio *bio_src, |
693 | struct bio_set *bs) | 694 | gfp_t gfp_mask, struct bio_set *bs) |
694 | { | 695 | { |
695 | struct bio_integrity_payload *bip_src = bio_src->bi_integrity; | 696 | struct bio_integrity_payload *bip_src = bio_src->bi_integrity; |
696 | struct bio_integrity_payload *bip; | 697 | struct bio_integrity_payload *bip; |
697 | 698 | ||
698 | BUG_ON(bip_src == NULL); | 699 | BUG_ON(bip_src == NULL); |
699 | 700 | ||
700 | bip = bio_integrity_alloc_bioset(bio, GFP_NOIO, bip_src->bip_vcnt, bs); | 701 | bip = bio_integrity_alloc_bioset(bio, gfp_mask, bip_src->bip_vcnt, bs); |
701 | 702 | ||
702 | if (bip == NULL) | 703 | if (bip == NULL) |
703 | return -EIO; | 704 | return -EIO; |
@@ -463,10 +463,12 @@ struct bio *bio_clone(struct bio *bio, gfp_t gfp_mask) | |||
463 | if (bio_integrity(bio)) { | 463 | if (bio_integrity(bio)) { |
464 | int ret; | 464 | int ret; |
465 | 465 | ||
466 | ret = bio_integrity_clone(b, bio, fs_bio_set); | 466 | ret = bio_integrity_clone(b, bio, gfp_mask, fs_bio_set); |
467 | 467 | ||
468 | if (ret < 0) | 468 | if (ret < 0) { |
469 | bio_put(b); | ||
469 | return NULL; | 470 | return NULL; |
471 | } | ||
470 | } | 472 | } |
471 | 473 | ||
472 | return b; | 474 | return b; |
diff --git a/include/linux/bio.h b/include/linux/bio.h index 1b16108a5417..d8bd43bfdcf5 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h | |||
@@ -531,7 +531,7 @@ extern void bio_integrity_endio(struct bio *, int); | |||
531 | extern void bio_integrity_advance(struct bio *, unsigned int); | 531 | extern void bio_integrity_advance(struct bio *, unsigned int); |
532 | extern void bio_integrity_trim(struct bio *, unsigned int, unsigned int); | 532 | extern void bio_integrity_trim(struct bio *, unsigned int, unsigned int); |
533 | extern void bio_integrity_split(struct bio *, struct bio_pair *, int); | 533 | extern void bio_integrity_split(struct bio *, struct bio_pair *, int); |
534 | extern int bio_integrity_clone(struct bio *, struct bio *, struct bio_set *); | 534 | extern int bio_integrity_clone(struct bio *, struct bio *, gfp_t, struct bio_set *); |
535 | extern int bioset_integrity_create(struct bio_set *, int); | 535 | extern int bioset_integrity_create(struct bio_set *, int); |
536 | extern void bioset_integrity_free(struct bio_set *); | 536 | extern void bioset_integrity_free(struct bio_set *); |
537 | extern void bio_integrity_init_slab(void); | 537 | extern void bio_integrity_init_slab(void); |
@@ -542,7 +542,7 @@ extern void bio_integrity_init_slab(void); | |||
542 | #define bioset_integrity_create(a, b) (0) | 542 | #define bioset_integrity_create(a, b) (0) |
543 | #define bio_integrity_prep(a) (0) | 543 | #define bio_integrity_prep(a) (0) |
544 | #define bio_integrity_enabled(a) (0) | 544 | #define bio_integrity_enabled(a) (0) |
545 | #define bio_integrity_clone(a, b, c) (0) | 545 | #define bio_integrity_clone(a, b, c,d ) (0) |
546 | #define bioset_integrity_free(a) do { } while (0) | 546 | #define bioset_integrity_free(a) do { } while (0) |
547 | #define bio_integrity_free(a, b) do { } while (0) | 547 | #define bio_integrity_free(a, b) do { } while (0) |
548 | #define bio_integrity_endio(a, b) do { } while (0) | 548 | #define bio_integrity_endio(a, b) do { } while (0) |