Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending

Pull SCSI target patches from Nicholas Bellinger:
"Here are the remaining target-pending patches for v3.9-rc1.

The most important one here is the immediate queue starvation
regression fix for iscsi-target, which addresses a bug that's
effecting v3.5+ kernels under heavy sustained READ only workloads.
Thanks alot to Benjamin Estrabaud for helping to track this down!

Also included is a pSCSI exception bugfix from Asias, along with a
handful of other minor changes. Both bugfixes are CC'ed to stable."

* 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending:
target/pscsi: Rename sg_num to nr_vecs in pscsi_get_bio()
target/pscsi: Fix page increment
target/pscsi: Drop unnecessary NULL assignment to bio->bi_next
target: Add __exit annotation for module_exit functions
iscsi-target: Fix immediate queue starvation regression with DATAIN

+15 -11
+9 -2
drivers/target/iscsi/iscsi_target.c
··· 3584 3584 spin_lock_bh(&cmd->istate_lock); 3585 3585 cmd->i_state = ISTATE_SENT_STATUS; 3586 3586 spin_unlock_bh(&cmd->istate_lock); 3587 + 3588 + if (atomic_read(&conn->check_immediate_queue)) 3589 + return 1; 3590 + 3587 3591 continue; 3588 3592 } else if (ret == 2) { 3589 3593 /* Still must send status, ··· 3677 3673 } 3678 3674 3679 3675 if (atomic_read(&conn->check_immediate_queue)) 3680 - break; 3676 + return 1; 3681 3677 } 3682 3678 3683 3679 return 0; ··· 3721 3717 signal_pending(current)) 3722 3718 goto transport_err; 3723 3719 3720 + get_immediate: 3724 3721 ret = handle_immediate_queue(conn); 3725 3722 if (ret < 0) 3726 3723 goto transport_err; 3727 3724 3728 3725 ret = handle_response_queue(conn); 3729 - if (ret == -EAGAIN) 3726 + if (ret == 1) 3727 + goto get_immediate; 3728 + else if (ret == -EAGAIN) 3730 3729 goto restart; 3731 3730 else if (ret < 0) 3732 3731 goto transport_err;
+1 -1
drivers/target/sbp/sbp_target.c
··· 2598 2598 return 0; 2599 2599 }; 2600 2600 2601 - static void sbp_exit(void) 2601 + static void __exit sbp_exit(void) 2602 2602 { 2603 2603 sbp_deregister_configfs(); 2604 2604 };
+1 -1
drivers/target/target_core_file.c
··· 631 631 return transport_subsystem_register(&fileio_template); 632 632 } 633 633 634 - static void fileio_module_exit(void) 634 + static void __exit fileio_module_exit(void) 635 635 { 636 636 transport_subsystem_release(&fileio_template); 637 637 }
+1 -1
drivers/target/target_core_iblock.c
··· 821 821 return transport_subsystem_register(&iblock_template); 822 822 } 823 823 824 - static void iblock_module_exit(void) 824 + static void __exit iblock_module_exit(void) 825 825 { 826 826 transport_subsystem_release(&iblock_template); 827 827 }
+3 -6
drivers/target/target_core_pscsi.c
··· 840 840 bio_put(bio); 841 841 } 842 842 843 - static inline struct bio *pscsi_get_bio(int sg_num) 843 + static inline struct bio *pscsi_get_bio(int nr_vecs) 844 844 { 845 845 struct bio *bio; 846 846 /* 847 847 * Use bio_malloc() following the comment in for bio -> struct request 848 848 * in block/blk-core.c:blk_make_request() 849 849 */ 850 - bio = bio_kmalloc(GFP_KERNEL, sg_num); 850 + bio = bio_kmalloc(GFP_KERNEL, nr_vecs); 851 851 if (!bio) { 852 852 pr_err("PSCSI: bio_kmalloc() failed\n"); 853 853 return NULL; ··· 940 940 bio = NULL; 941 941 } 942 942 943 - page++; 944 943 len -= bytes; 945 944 data_len -= bytes; 946 945 off = 0; ··· 951 952 while (*hbio) { 952 953 bio = *hbio; 953 954 *hbio = (*hbio)->bi_next; 954 - bio->bi_next = NULL; 955 955 bio_endio(bio, 0); /* XXX: should be error */ 956 956 } 957 957 return TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE; ··· 1090 1092 while (hbio) { 1091 1093 struct bio *bio = hbio; 1092 1094 hbio = hbio->bi_next; 1093 - bio->bi_next = NULL; 1094 1095 bio_endio(bio, 0); /* XXX: should be error */ 1095 1096 } 1096 1097 ret = TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE; ··· 1175 1178 return transport_subsystem_register(&pscsi_template); 1176 1179 } 1177 1180 1178 - static void pscsi_module_exit(void) 1181 + static void __exit pscsi_module_exit(void) 1179 1182 { 1180 1183 transport_subsystem_release(&pscsi_template); 1181 1184 }