Re: [PATCH v1] ibmvscsis: Use tpgt passed in by user
On Tue, 2017-06-06 at 15:45 -0500, Bryant G. Ly wrote: > ibmvscsis always returned 0 for the tpg/tag, since it did not > parse the value passed in by the user. > > When functions like ALUA members exports the value, it will > be incorrect because targetcli/rtslib starts the tpg numbering > at 1. > > Signed-off-by: Bryant G. Ly> Signed-off-by: Mike Christie > --- > drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c | 8 > 1 file changed, 8 insertions(+) Applied to target-pending/for-next. Thanks Bryant + MNC.
Re: [PATCH 2/3] target: Add TARGET_SCF_LOOKUP_LUN_FROM_TAG support for ABORT_TASK
On Mon, 2017-06-05 at 15:57 +, Bart Van Assche wrote: > On Sat, 2017-06-03 at 22:10 +, Nicholas A. Bellinger wrote: > > +static bool target_lookup_lun_from_tag(struct se_session *se_sess, u64 tag, > > + u64 *unpacked_lun) > > +{ > > + struct se_cmd *se_cmd; > > + unsigned long flags; > > + bool ret = false; > > + > > + spin_lock_irqsave(_sess->sess_cmd_lock, flags); > > + list_for_each_entry(se_cmd, _sess->sess_cmd_list, se_cmd_list) { > > + if (se_cmd->se_cmd_flags & SCF_SCSI_TMR_CDB) > > + continue; > > + > > + if (se_cmd->tag == tag) { > > + *unpacked_lun = se_cmd->orig_fe_lun; > > + ret = true; > > + break; > > + } > > + } > > + spin_unlock_irqrestore(_sess->sess_cmd_lock, flags); > > + > > + return ret; > > +} > > + > > /** > > * target_submit_tmr - lookup unpacked lun and submit uninitialized se_cmd > > * for TMR CDBs > > @@ -1639,19 +1662,31 @@ int target_submit_tmr(struct se_cmd *se_cmd, struct > > se_session *se_sess, > > core_tmr_release_req(se_cmd->se_tmr_req); > > return ret; > > } > > + /* > > +* If this is ABORT_TASK with no explicit fabric provided LUN, > > +* go ahead and search active session tags for a match to figure > > +* out unpacked_lun for the original se_cmd. > > +*/ > > + if (tm_type == TMR_ABORT_TASK && (flags & > > TARGET_SCF_LOOKUP_LUN_FROM_TAG)) { > > + if (!target_lookup_lun_from_tag(se_sess, tag, _lun)) > > + goto failure; > > + } > > > > ret = transport_lookup_tmr_lun(se_cmd, unpacked_lun); > > - if (ret) { > > - /* > > -* For callback during failure handling, push this work off > > -* to process context with TMR_LUN_DOES_NOT_EXIST status. > > -*/ > > - INIT_WORK(_cmd->work, target_complete_tmr_failure); > > - schedule_work(_cmd->work); > > - return 0; > > - } > > + if (ret) > > + goto failure; > > + > > transport_generic_handle_tmr(se_cmd); > > return 0; > > Hello Nic, > > So after LUN lookup has finished sess_cmd_lock lock is dropped, a context > switch occurs due to the queue_work() call in transport_generic_handle_tmr() > and next core_tmr_abort_task() reacquires that lock? Sorry but I'm afraid > that if after that lock is dropped and before it is reacquired a command > finishes and the initiator reuses the same tag for another command for the > same LUN that this may result in the wrong command being aborted. This is only getting a unpacked_lun to determine where the incoming ABORT_TASK should perform a se_lun lookup and percpu ref upon. The scenario you are talking about would require a tag be reused on the same session for the same device between when the ABORT_TASK is dispatched here, and actually processed. Because qla2xxx doesn't reuse tags, it's not a problem since it's the only consumer of TARGET_SCF_LOOKUP_LUN_FROM_TAG. Since Himanshu and Quinn are OK it with, I'm OK with it. If you have another driver that needs to use this logic where an ABORT_TASK doesn't know the unpacked_lun to reference, and does reuse tags then I'd consider a patch for that.
Re: [PATCH 0/3] target: Add TARGET_SCF_LOOKUP_LUN_FROM_TAG support
Hi Himanshu & Quinn, On Wed, 2017-06-07 at 05:02 +, Madhani, Himanshu wrote: > > On Jun 3, 2017, at 3:10 PM, Nicholas A. Bellinger> > wrote: > > > > From: Nicholas Bellinger > > > > Hi Himanshu + Quinn, > > > > Here is a small series to introduce proper percpu se_lun->lun_ref > > counting for TMR, and add common code in target_submit_tmr() to > > do tag lookup for unpacked_lun in order to drop the original > > driver specific lookup within __qlt_24xx_handle_abts(). > > > > It's rather straight-forward, so review and test as a v4.13 item. > > > > Thanks! > > > > Nicholas Bellinger (3): > > target: Add support for TMR percpu reference counting > > target: Add TARGET_SCF_LOOKUP_LUN_FROM_TAG support for ABORT_TASK > > qla2xxx: Convert QLA_TGT_ABTS to TARGET_SCF_LOOKUP_LUN_FROM_TAG > > > > drivers/scsi/qla2xxx/qla_target.c | 39 ++- > > drivers/scsi/qla2xxx/tcm_qla2xxx.c | 4 ++- > > drivers/target/target_core_device.c| 14 ++--- > > drivers/target/target_core_transport.c | 56 > > -- > > include/target/target_core_base.h | 3 +- > > 5 files changed, 71 insertions(+), 45 deletions(-) > > > > -- > > 1.9.1 > > > > -- > > To unsubscribe from this list: send the line "unsubscribe target-devel" in > > the body of a message to majord...@vger.kernel.org > > More majordomo info at http://vger.kernel.org/majordomo-info.html > > Series looks good. > > Acked-by: Himanshu Madhani > Thanks for the review!
Re: [PATCH] iscsi-target: Fix delayed logout processing greater than SECONDS_FOR_LOGOUT_COMP
Reviews pretty please..? On Sat, 2017-06-03 at 21:32 +, Nicholas A. Bellinger wrote: > From: Nicholas Bellinger> > This patch fixes a BUG() in iscsit_close_session() that could be > triggered when iscsit_logout_post_handler() execution from within > tx thread context was not run for more than SECONDS_FOR_LOGOUT_COMP > (15 seconds), and the TCP connection didn't already close before > then forcing tx thread context to automatically exit. > > This would manifest itself during explicit logout as: > > [33206.974254] 1 connection(s) still exist for iSCSI session to > iqn.1993-08.org.debian:01:3f5523242179 > [33206.980184] INFO: NMI handler (kgdb_nmi_handler) took too long to run: > 2100.772 msecs > [33209.078643] [ cut here ] > [33209.078646] kernel BUG at drivers/target/iscsi/iscsi_target.c:4346! > > Normally when explicit logout attempt fails, the tx thread context > exits and iscsit_close_connection() from rx thread context does the > extra cleanup once it detects conn->conn_logout_remove has not been > cleared by the logout type specific post handlers. > > To address this special case, if the logout post handler in tx thread > context detects conn->tx_thread_active has already been cleared, simply > return and exit in order for existing iscsit_close_connection() > logic from rx thread context do failed logout cleanup. > > Reported-by: Bart Van Assche > Cc: Mike Christie > Cc: Hannes Reinecke > Cc: Sagi Grimberg > Cc: sta...@vger.kernel.org # 3.14+ > Signed-off-by: Nicholas Bellinger > --- > drivers/target/iscsi/iscsi_target.c | 10 -- > 1 file changed, 8 insertions(+), 2 deletions(-) > > diff --git a/drivers/target/iscsi/iscsi_target.c > b/drivers/target/iscsi/iscsi_target.c > index 0d8f815..c025451 100644 > --- a/drivers/target/iscsi/iscsi_target.c > +++ b/drivers/target/iscsi/iscsi_target.c > @@ -4423,8 +4423,11 @@ static void iscsit_logout_post_handler_closesession( >* always sleep waiting for RX/TX thread shutdown to complete >* within iscsit_close_connection(). >*/ > - if (!conn->conn_transport->rdma_shutdown) > + if (!conn->conn_transport->rdma_shutdown) { > sleep = cmpxchg(>tx_thread_active, true, false); > + if (!sleep) > + return; > + } > > atomic_set(>conn_logout_remove, 0); > complete(>conn_logout_comp); > @@ -4440,8 +4443,11 @@ static void iscsit_logout_post_handler_samecid( > { > int sleep = 1; > > - if (!conn->conn_transport->rdma_shutdown) > + if (!conn->conn_transport->rdma_shutdown) { > sleep = cmpxchg(>tx_thread_active, true, false); > + if (!sleep) > + return; > + } > > atomic_set(>conn_logout_remove, 0); > complete(>conn_logout_comp);
Re: [PATCH] target: Fix kref->refcount underflow in transport_cmd_finish_abort
(Adding Quinn CC') Reviews please..? On Sat, 2017-06-03 at 21:09 +, Nicholas A. Bellinger wrote: > From: Nicholas Bellinger> > This patch fixes a se_cmd->cmd_kref underflow during CMD_T_ABORTED > when a fabric driver drops it's second reference from below the > target_core_tmr.c based callers of transport_cmd_finish_abort(). > > Recently with the conversion of kref to refcount_t, this bug was > manifesting itself as: > > [705519.601034] refcount_t: underflow; use-after-free. > [705519.604034] INFO: NMI handler (kgdb_nmi_handler) took too long to run: > 20116.512 msecs > [705539.719111] [ cut here ] > [705539.719117] WARNING: CPU: 3 PID: 26510 at lib/refcount.c:184 > refcount_sub_and_test+0x33/0x51 > > Since the original kref atomic_t based kref_put() didn't check for > underflow and only invoked the final callback when zero was reached, > this bug did not manifest in practice since all se_cmd memory is > using preallocated tags. > > To address this, go ahead and propigate the existing return from > transport_put_cmd() up via transport_cmd_finish_abort(), and > change transport_cmd_finish_abort() + core_tmr_handle_tas_abort() > callers to only do their local target_put_sess_cmd() if necessary. > > Reported-by: Bart Van Assche > Cc: Mike Christie > Cc: Hannes Reinecke > Cc: Christoph Hellwig > Cc: Himanshu Madhani > Cc: Sagi Grimberg > Cc: sta...@vger.kernel.org # 3.14+ > Signed-off-by: Nicholas Bellinger > --- > drivers/target/target_core_internal.h | 2 +- > drivers/target/target_core_tmr.c | 16 > drivers/target/target_core_transport.c | 9 ++--- > 3 files changed, 15 insertions(+), 12 deletions(-) > > diff --git a/drivers/target/target_core_internal.h > b/drivers/target/target_core_internal.h > index 9ab7090..0912de7 100644 > --- a/drivers/target/target_core_internal.h > +++ b/drivers/target/target_core_internal.h > @@ -136,7 +136,7 @@ struct se_node_acl > *core_tpg_add_initiator_node_acl(struct se_portal_group *tpg, > void release_se_kmem_caches(void); > u32 scsi_get_new_index(scsi_index_t); > void transport_subsystem_check_init(void); > -void transport_cmd_finish_abort(struct se_cmd *, int); > +int transport_cmd_finish_abort(struct se_cmd *, int); > unsigned char *transport_dump_cmd_direction(struct se_cmd *); > void transport_dump_dev_state(struct se_device *, char *, int *); > void transport_dump_dev_info(struct se_device *, struct se_lun *, > diff --git a/drivers/target/target_core_tmr.c > b/drivers/target/target_core_tmr.c > index dce1e1b..13f47bf 100644 > --- a/drivers/target/target_core_tmr.c > +++ b/drivers/target/target_core_tmr.c > @@ -75,7 +75,7 @@ void core_tmr_release_req(struct se_tmr_req *tmr) > kfree(tmr); > } > > -static void core_tmr_handle_tas_abort(struct se_cmd *cmd, int tas) > +static int core_tmr_handle_tas_abort(struct se_cmd *cmd, int tas) > { > unsigned long flags; > bool remove = true, send_tas; > @@ -91,7 +91,7 @@ static void core_tmr_handle_tas_abort(struct se_cmd *cmd, > int tas) > transport_send_task_abort(cmd); > } > > - transport_cmd_finish_abort(cmd, remove); > + return transport_cmd_finish_abort(cmd, remove); > } > > static int target_check_cdb_and_preempt(struct list_head *list, > @@ -184,8 +184,8 @@ void core_tmr_abort_task( > cancel_work_sync(_cmd->work); > transport_wait_for_tasks(se_cmd); > > - transport_cmd_finish_abort(se_cmd, true); > - target_put_sess_cmd(se_cmd); > + if (!transport_cmd_finish_abort(se_cmd, true)) > + target_put_sess_cmd(se_cmd); > > printk("ABORT_TASK: Sending TMR_FUNCTION_COMPLETE for" > " ref_tag: %llu\n", ref_tag); > @@ -281,8 +281,8 @@ static void core_tmr_drain_tmr_list( > cancel_work_sync(>work); > transport_wait_for_tasks(cmd); > > - transport_cmd_finish_abort(cmd, 1); > - target_put_sess_cmd(cmd); > + if (!transport_cmd_finish_abort(cmd, 1)) > + target_put_sess_cmd(cmd); > } > } > > @@ -380,8 +380,8 @@ static void core_tmr_drain_state_list( > cancel_work_sync(>work); > transport_wait_for_tasks(cmd); > > - core_tmr_handle_tas_abort(cmd, tas); > - target_put_sess_cmd(cmd); > + if (!core_tmr_handle_tas_abort(cmd, tas)) > + target_put_sess_cmd(cmd); > } > } > > diff --git a/drivers/target/target_core_transport.c > b/drivers/target/target_core_transport.c > index 6025935..f1b3a46 100644 > --- a/drivers/target/target_core_transport.c > +++ b/drivers/target/target_core_transport.c > @@ -651,9 +651,10 @@ static
Re: [RFC v2 2/2] scsi: add rate limit to scsi sense code uevent
> On Jun 6, 2017, at 6:22 AM, Ewan D. Milnewrote: > > On Thu, 2017-05-18 at 11:14 -0700, Song Liu wrote: >> This patch adds rate limits to SCSI sense code uevets. Currently, >> the rate limit is hard-coded to 16 events per second. >> >> The code tracks nano second time of latest 16 events in a circular >> buffer. When a new event arrives, the time is compared against the >> latest time in the buffer. If the difference is smaller than one >> second, the new event is dropped. >> >> Signed-off-by: Song Liu >> --- >> drivers/scsi/scsi_error.c | 15 +++ >> drivers/scsi/scsi_scan.c | 4 >> include/scsi/scsi_device.h | 12 +++- >> 3 files changed, 30 insertions(+), 1 deletion(-) >> >> diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c >> index a49c63a..91e6b0a 100644 >> --- a/drivers/scsi/scsi_error.c >> +++ b/drivers/scsi/scsi_error.c >> @@ -436,11 +436,26 @@ static void scsi_send_sense_uevent(struct scsi_device >> *sdev, >> #ifdef CONFIG_SCSI_SENSE_UEVENT >> struct scsi_event *evt; >> unsigned char sb_len; >> +unsigned long flags; >> +u64 time_ns; >> >> if (!test_bit(sshdr->sense_key & 0xf, >>>sense_event_filter)) >> return; >> evt = sdev_evt_alloc(SDEV_EVT_SCSI_SENSE, GFP_ATOMIC); >> + >> +time_ns = ktime_to_ns(ktime_get()); >> +spin_lock_irqsave(>latest_event_lock, flags); >> +if (time_ns - sdev->latest_event_times[sdev->latest_event_idx] < >> +NSEC_PER_SEC) { >> +spin_unlock_irqrestore(>latest_event_lock, flags); >> +return; > > You have an allocated evt here, so if you return here you will leak > kernel memory. I will fix this in next version. > > This code appears to be rate limiting per-sdev. You have to remember > that on a large system, there could be thousands of these devices. > You could easily end up generating 10s or 100s of thousands of events > per second, in a very short amount of time under certain failure > conditions. > > The udev event mechanism can realistically only process a few > hundred events per second before it starts getting behind, due to > the rule processing engine (the rules in userspace). > > You also have to consider that if you clog up udev with a lot of > your events, you affect event processing for other events. > Yeah, this is great point. Would Scsi_Host level rate limiting make sense for this type of cases? Or shall I add a global rate limit? Thanks, Song
[PATCH] scsi: ipr: remove unnecessary variable assignments and the variable itself
Remove unnecessary variable assignments, the variable itself and refactor the code. Addresses-Coverity-ID: 1227034 Signed-off-by: Gustavo A. R. Silva--- drivers/scsi/ipr.c | 12 +--- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c index b0c68d2..633db65 100644 --- a/drivers/scsi/ipr.c +++ b/drivers/scsi/ipr.c @@ -8414,7 +8414,6 @@ static int ipr_reset_next_stage(struct ipr_cmnd *ipr_cmd) static int ipr_reset_enable_ioa(struct ipr_cmnd *ipr_cmd) { struct ipr_ioa_cfg *ioa_cfg = ipr_cmd->ioa_cfg; - volatile u32 int_reg; volatile u64 maskval; int i; @@ -8431,15 +8430,14 @@ static int ipr_reset_enable_ioa(struct ipr_cmnd *ipr_cmd) if (ioa_cfg->sis64) { /* Set the adapter to the correct endian mode. */ writel(IPR_ENDIAN_SWAP_KEY, ioa_cfg->regs.endian_swap_reg); - int_reg = readl(ioa_cfg->regs.endian_swap_reg); + readl(ioa_cfg->regs.endian_swap_reg); } - int_reg = readl(ioa_cfg->regs.sense_interrupt_reg32); - - if (int_reg & IPR_PCII_IOA_TRANS_TO_OPER) { + if (readl(ioa_cfg->regs.sense_interrupt_reg32) & + IPR_PCII_IOA_TRANS_TO_OPER) { writel((IPR_PCII_ERROR_INTERRUPTS | IPR_PCII_HRRQ_UPDATED), ioa_cfg->regs.clr_interrupt_mask_reg32); - int_reg = readl(ioa_cfg->regs.sense_interrupt_mask_reg); + readl(ioa_cfg->regs.sense_interrupt_mask_reg); return IPR_RC_JOB_CONTINUE; } @@ -8453,7 +8451,7 @@ static int ipr_reset_enable_ioa(struct ipr_cmnd *ipr_cmd) } else writel(IPR_PCII_OPER_INTERRUPTS, ioa_cfg->regs.clr_interrupt_mask_reg32); - int_reg = readl(ioa_cfg->regs.sense_interrupt_mask_reg); + readl(ioa_cfg->regs.sense_interrupt_mask_reg); dev_info(_cfg->pdev->dev, "Initializing IOA.\n"); -- 2.5.0
Re: [PATCH 06/15] qla2xxx: Add fw_started flags to qpair
Hi Quinn, [auto build test ERROR on scsi/for-next] [also build test ERROR on next-20170608] [cannot apply to v4.12-rc4] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/Himanshu-Madhani/qla2xxx-Add-Target-Multiqueue-support/20170608-063551 base: https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git for-next config: x86_64-acpi-redef (attached as .config) compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901 reproduce: # save the attached .config to linux build tree make ARCH=x86_64 Note: the linux-review/Himanshu-Madhani/qla2xxx-Add-Target-Multiqueue-support/20170608-063551 HEAD 71026a5288a1cc5580ca466af592e9c9fd157c78 builds fine. It only hurts bisectibility. All errors (new ones prefixed by >>): drivers/scsi/qla2xxx/qla_target.c: In function 'qlt_xmit_response': >> drivers/scsi/qla2xxx/qla_target.c:3088:53: error: 'struct qla_qpair' has no >> member named 'chip_reset' if (!qpair->fw_started || cmd->reset_count != qpair->chip_reset) { ^~ >> drivers/scsi/qla2xxx/qla_target.c:3098:22: error: 'ha' undeclared (first use >> in this function) cmd->reset_count, ha->chip_reset); ^~ drivers/scsi/qla2xxx/qla_target.c:3098:22: note: each undeclared identifier is reported only once for each function it appears in drivers/scsi/qla2xxx/qla_target.c: In function 'qlt_rdy_to_xfer': drivers/scsi/qla2xxx/qla_target.c:3224:54: error: 'struct qla_qpair' has no member named 'chip_reset' if (!qpair->fw_started || (cmd->reset_count != qpair->chip_reset) || ^~ drivers/scsi/qla2xxx/qla_target.c:3235:22: error: 'ha' undeclared (first use in this function) cmd->reset_count, ha->chip_reset); ^~ vim +3088 drivers/scsi/qla2xxx/qla_target.c 3082 3083 if (xmit_type == QLA_TGT_XMIT_STATUS) 3084 vha->tgt_counters.core_qla_snd_status++; 3085 else 3086 vha->tgt_counters.core_qla_que_buf++; 3087 > 3088 if (!qpair->fw_started || cmd->reset_count != > qpair->chip_reset) { 3089 /* 3090 * Either the port is not online or this request was from 3091 * previous life, just abort the processing. 3092 */ 3093 cmd->state = QLA_TGT_STATE_PROCESSED; 3094 qlt_abort_cmd_on_host_reset(cmd->vha, cmd); 3095 ql_dbg(ql_dbg_async, vha, 0xe101, 3096 "RESET-RSP online/active/old-count/new-count = %d/%d/%d/%d.\n", 3097 vha->flags.online, qla2x00_reset_active(vha), > 3098 cmd->reset_count, ha->chip_reset); 3099 spin_unlock_irqrestore(qpair->qp_lock_ptr, flags); 3100 return 0; 3101 } --- 0-DAY kernel test infrastructureOpen Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation .config.gz Description: application/gzip
Re: [PATCH v3 04/12] Protect SCSI device state changes with a mutex
On Mon, Jun 05, 2017 at 06:36:19PM +, Bart Van Assche wrote: > > The mpt3sas driver is the only driver that calls > > scsi_internal_device_block() > > and scsi_internal_device_unblock() from atomic context. Since it's not an > > option > > to protect the SCSI device state changes with a spinlock I prefer that the > > mpt3sas authors convert the scsi_internal_device_block() calls into > > scsi_target_block() calls. > > Please also note that although this patch series doesn't improve the mpt3sas > driver, it doesn't change its behavior. Yes. And normally we try to get things right. I guess this series is useful enough without fixing everyone up, but adding a FIXME or getting the broadcom folks involved would be even better.
Re: [PATCH] iscsi-target: Reject immediate data underflow larger than SCSI transfer length
On Thu, 2017-06-08 at 04:21 +, Nicholas A. Bellinger wrote: > + /* > + * Check for underflow case where both EDTL and immediate data payload > + * exceeds what is presented by CDB's TRANSFER LENGTH, and what has > + * already been set in target_cmd_size_check() as se_cmd->data_length. > + * > + * For this special case, fail the command and dump the immediate data > + * payload. > + */ > + if (cmd->first_burst_len > cmd->se_cmd.data_length) { > + cmd->sense_reason = TCM_INVALID_CDB_FIELD; > + goto after_immediate_data; > + } A quote from the iSCSI RFC (https://tools.ietf.org/html/rfc5048): If SPDTL < EDTL for a task, iSCSI Underflow MUST be signaled in the SCSI Response PDU as specified in [RFC3720]. The Residual Count MUST be set to the numerical value of (EDTL - SPDTL). Sorry but I don't think that sending TCM_INVALID_CDB_FIELD back to the initiator is compliant with the iSCSI RFC. Please note that a fix that is compliant with the iSCSI RFC is present in the following patch series: [PATCH 00/33] SCSI target driver patches for kernel v4.13, 23 May 2017 (https://www.spinics.net/lists/target-devel/msg15370.html). Bart.
Re: [PATCH 0/2] esas2r: Replace semaphores with mutexes
On Thu, Jun 8, 2017 at 12:07 PM, Binoy Jayanwrote: > These are a set of patches which removes semaphores from esas2r. > These are part of a bigger effort to eliminate unwanted semaphores > from the linux kernel. > > Binoy Jayan (2): > scsi: esas2r: Replace semaphore fm_api_semaphore with mutex > scsi: esas2r: Replace semaphore fs_api_semaphore with mutex Both conversions looks good. I think the interruption is not handled correctly here, but your patch doesn't change that. Reviewed-by: Arnd Bergmann
Re: [PATCH 2/7] scsi/scsi_transport_iscsi: Update ep_connect to include iface.
Hi Robert, [auto build test ERROR on mkp-scsi/for-next] [also build test ERROR on v4.12-rc4 next-20170608] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/Robert-LeBlanc/Enable-iSCSI-offload-drivers-to-use-information-from-iface/20170607-211934 base: https://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git for-next config: ia64-allmodconfig (attached as .config) compiler: ia64-linux-gcc (GCC) 6.2.0 reproduce: wget https://raw.githubusercontent.com/01org/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # save the attached .config to linux build tree make.cross ARCH=ia64 All errors (new ones prefixed by >>): >> drivers/scsi//qedi/qedi_iscsi.c:1402:16: error: initialization from >> incompatible pointer type [-Werror=incompatible-pointer-types] .ep_connect = qedi_ep_connect, ^~~ drivers/scsi//qedi/qedi_iscsi.c:1402:16: note: (near initialization for 'qedi_iscsi_transport.ep_connect') cc1: some warnings being treated as errors vim +1402 drivers/scsi//qedi/qedi_iscsi.c ace7f46b Manish Rangankar 2016-12-01 1386 .destroy_session = qedi_session_destroy, ace7f46b Manish Rangankar 2016-12-01 1387 .create_conn = qedi_conn_create, ace7f46b Manish Rangankar 2016-12-01 1388 .bind_conn = qedi_conn_bind, ace7f46b Manish Rangankar 2016-12-01 1389 .start_conn = qedi_conn_start, ace7f46b Manish Rangankar 2016-12-01 1390 .stop_conn = iscsi_conn_stop, ace7f46b Manish Rangankar 2016-12-01 1391 .destroy_conn = qedi_conn_destroy, ace7f46b Manish Rangankar 2016-12-01 1392 .set_param = iscsi_set_param, ace7f46b Manish Rangankar 2016-12-01 1393 .get_ep_param = qedi_ep_get_param, ace7f46b Manish Rangankar 2016-12-01 1394 .get_conn_param = iscsi_conn_get_param, ace7f46b Manish Rangankar 2016-12-01 1395 .get_session_param = iscsi_session_get_param, ace7f46b Manish Rangankar 2016-12-01 1396 .get_host_param = qedi_host_get_param, ace7f46b Manish Rangankar 2016-12-01 1397 .send_pdu = iscsi_conn_send_pdu, ace7f46b Manish Rangankar 2016-12-01 1398 .get_stats = qedi_conn_get_stats, ace7f46b Manish Rangankar 2016-12-01 1399 .xmit_task = qedi_task_xmit, ace7f46b Manish Rangankar 2016-12-01 1400 .cleanup_task = qedi_cleanup_task, ace7f46b Manish Rangankar 2016-12-01 1401 .session_recovery_timedout = iscsi_session_recovery_timedout, ace7f46b Manish Rangankar 2016-12-01 @1402 .ep_connect = qedi_ep_connect, ace7f46b Manish Rangankar 2016-12-01 1403 .ep_poll = qedi_ep_poll, ace7f46b Manish Rangankar 2016-12-01 1404 .ep_disconnect = qedi_ep_disconnect, ace7f46b Manish Rangankar 2016-12-01 1405 .set_path = qedi_set_path, ace7f46b Manish Rangankar 2016-12-01 1406 .attr_is_visible = qedi_attr_is_visible, ace7f46b Manish Rangankar 2016-12-01 1407 }; ace7f46b Manish Rangankar 2016-12-01 1408 ace7f46b Manish Rangankar 2016-12-01 1409 void qedi_start_conn_recovery(struct qedi_ctx *qedi, ace7f46b Manish Rangankar 2016-12-01 1410struct qedi_conn *qedi_conn) :: The code at line 1402 was first introduced by commit :: ace7f46ba5fde7273207c7122b0650ceb72510e0 scsi: qedi: Add QLogic FastLinQ offload iSCSI driver framework. :: TO: Manish Rangankar <manish.rangan...@cavium.com> :: CC: Martin K. Petersen <martin.peter...@oracle.com> --- 0-DAY kernel test infrastructureOpen Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation .config.gz Description: application/gzip
Re: [PATCH] configfs: Fix race between create_link and configfs_rmdir
Thanks Nic, applied to the configfs-for-next tree. I'm not entirely sure if we should bother adding this to 4.12 or if it hits rarely enough? It hits for us pretty often when we have a GPFS setup with 10 hosts and 1k+ vms. That is how we discovered the bug in the first place. -Bryant
Re: [PATCH 2/7] scsi: ibmvscsi_tgt: remove use of class_attrs
The class_attrs pointer is going away and it's not even being used in this driver, so just remove it entirely. Cc: "Bryant G. Ly"Cc: Michael Cyr Cc: "James E.J. Bottomley" Cc: "Martin K. Petersen" Cc: Cc: Signed-off-by: Greg Kroah-Hartman --- drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c | 5 - 1 file changed, 5 deletions(-) diff --git a/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c b/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c index d390325c99ec..b480878e3258 100644 --- a/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c +++ b/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c @@ -3915,10 +3915,6 @@ static const struct target_core_fabric_ops ibmvscsis_ops = { static void ibmvscsis_dev_release(struct device *dev) {}; -static struct class_attribute ibmvscsis_class_attrs[] = { - __ATTR_NULL, -}; - static struct device_attribute dev_attr_system_id = __ATTR(system_id, S_IRUGO, system_id_show, NULL); @@ -3938,7 +3934,6 @@ ATTRIBUTE_GROUPS(ibmvscsis_dev); static struct class ibmvscsis_class = { .name = "ibmvscsis", .dev_release= ibmvscsis_dev_release, - .class_attrs= ibmvscsis_class_attrs, .dev_groups = ibmvscsis_dev_groups, }; Thanks Greg, ACK. -Bryant
Re: [PATCH 1/7] scsi/scsi_transport_iscsi: Add iface struct to kernel.
Hi Robert, [auto build test ERROR on mkp-scsi/for-next] [also build test ERROR on v4.12-rc4 next-20170608] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/Robert-LeBlanc/Enable-iSCSI-offload-drivers-to-use-information-from-iface/20170607-211934 base: https://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git for-next config: ia64-allmodconfig (attached as .config) compiler: ia64-linux-gcc (GCC) 6.2.0 reproduce: wget https://raw.githubusercontent.com/01org/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # save the attached .config to linux build tree make.cross ARCH=ia64 All errors (new ones prefixed by >>): In file included from include/scsi/libiscsi.h:35:0, from drivers/scsi/be2iscsi/be_iscsi.c:15: >> include/scsi/scsi_transport_iscsi.h:308:16: error: 'IFNAMSIZ' undeclared >> here (not in a function) char netdev[IFNAMSIZ]; ^~~~ vim +/IFNAMSIZ +308 include/scsi/scsi_transport_iscsi.h 302 struct iface_rec { 303 struct list_headlist; 304 /* iscsi iface record name */ 305 charname[ISCSI_MAX_IFACE_LEN]; 306 uint32_tiface_num; 307 /* network layer iface name (eth0) */ > 308 charnetdev[IFNAMSIZ]; 309 charipaddress[NI_MAXHOST]; 310 charsubnet_mask[NI_MAXHOST]; 311 chargateway[NI_MAXHOST]; --- 0-DAY kernel test infrastructureOpen Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation .config.gz Description: application/gzip
Re: [PATCH 2/7] scsi/scsi_transport_iscsi: Update ep_connect to include iface.
Hi Robert, [auto build test ERROR on mkp-scsi/for-next] [also build test ERROR on v4.12-rc4 next-20170608] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/Robert-LeBlanc/Enable-iSCSI-offload-drivers-to-use-information-from-iface/20170607-211934 base: https://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git for-next config: x86_64-kexec (attached as .config) compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901 reproduce: # save the attached .config to linux build tree make ARCH=x86_64 Note: the linux-review/Robert-LeBlanc/Enable-iSCSI-offload-drivers-to-use-information-from-iface/20170607-211934 HEAD 9d84638ec1dd56cf18d796045165770d741fe422 builds fine. It only hurts bisectibility. All errors (new ones prefixed by >>): >> drivers/scsi/qla4xxx/ql4_os.c:236:17: error: initialization from >> incompatible pointer type [-Werror=incompatible-pointer-types] .ep_connect = qla4xxx_ep_connect, ^~ drivers/scsi/qla4xxx/ql4_os.c:236:17: note: (near initialization for 'qla4xxx_iscsi_transport.ep_connect') cc1: some warnings being treated as errors vim +236 drivers/scsi/qla4xxx/ql4_os.c b3a271a9 Manish Rangankar 2011-07-25 220 .caps = CAP_TEXT_NEGO | b3a271a9 Manish Rangankar 2011-07-25 221 CAP_DATA_PATH_OFFLOAD | CAP_HDRDGST | b3a271a9 Manish Rangankar 2011-07-25 222 CAP_DATADGST | CAP_LOGIN_OFFLOAD | b3a271a9 Manish Rangankar 2011-07-25 223 CAP_MULTI_R2T, 5e9bcec7 Vikas Chaudhary 2012-08-22 224 .attr_is_visible= qla4_attr_is_visible, b3a271a9 Manish Rangankar 2011-07-25 225 .create_session = qla4xxx_session_create, b3a271a9 Manish Rangankar 2011-07-25 226 .destroy_session= qla4xxx_session_destroy, b3a271a9 Manish Rangankar 2011-07-25 227 .start_conn = qla4xxx_conn_start, b3a271a9 Manish Rangankar 2011-07-25 228 .create_conn= qla4xxx_conn_create, b3a271a9 Manish Rangankar 2011-07-25 229 .bind_conn = qla4xxx_conn_bind, b3a271a9 Manish Rangankar 2011-07-25 230 .stop_conn = iscsi_conn_stop, b3a271a9 Manish Rangankar 2011-07-25 231 .destroy_conn = qla4xxx_conn_destroy, b3a271a9 Manish Rangankar 2011-07-25 232 .set_param = iscsi_set_param, afaf5a2d David Somayajulu 2006-09-19 233 .get_conn_param = qla4xxx_conn_get_param, fca9f04d Mike Christie2012-02-27 234 .get_session_param = qla4xxx_session_get_param, b3a271a9 Manish Rangankar 2011-07-25 235 .get_ep_param = qla4xxx_get_ep_param, b3a271a9 Manish Rangankar 2011-07-25 @236 .ep_connect = qla4xxx_ep_connect, b3a271a9 Manish Rangankar 2011-07-25 237 .ep_poll= qla4xxx_ep_poll, b3a271a9 Manish Rangankar 2011-07-25 238 .ep_disconnect = qla4xxx_ep_disconnect, b3a271a9 Manish Rangankar 2011-07-25 239 .get_stats = qla4xxx_conn_get_stats, b3a271a9 Manish Rangankar 2011-07-25 240 .send_pdu = iscsi_conn_send_pdu, b3a271a9 Manish Rangankar 2011-07-25 241 .xmit_task = qla4xxx_task_xmit, b3a271a9 Manish Rangankar 2011-07-25 242 .cleanup_task = qla4xxx_task_cleanup, b3a271a9 Manish Rangankar 2011-07-25 243 .alloc_pdu = qla4xxx_alloc_pdu, b3a271a9 Manish Rangankar 2011-07-25 244 :: The code at line 236 was first introduced by commit :: b3a271a94d0034dd3bab10b8d8cd432843be629e [SCSI] qla4xxx: support iscsiadm session mgmt :: TO: Manish Rangankar <manish.rangan...@qlogic.com> :: CC: James Bottomley <jbottom...@parallels.com> --- 0-DAY kernel test infrastructureOpen Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation .config.gz Description: application/gzip
Re: [PATCH v3 14/23] scsi: hisi_sas: add v3 cq interrupt handler
On 08/06/2017 08:34, Christoph Hellwig wrote: Hi John, sorry for dropping the ball, but your repost reminded me. On Thu, Jun 01, 2017 at 11:36:55AM +0100, John Garry wrote: In the command completion code we need to check for abnormal completion due to underflow, but ignore it when it occurs in some commands, like inquiry. This is why we check for rw command - it is equivalent to !inquiry. I'll see if we can change the check to explicitly ignore certain commands which complete abnormally with underflow. In general it should be up to the higher level and not the driver to detect underflow, and that's how most (hopefully all, but I won't bet on some older ones) of our drivers operate. Hi Christoph, Right, I see most LLDDs will not check for underflow; but, FWIW, I do see scsi_cmnd.underflow referenced in some... However, for drivers using libsas, we detect underflow for the reason just so libsas knows the sas_task status (SAS_DATA_UNDERRUN) and sets the scsi cmd result properly (and also the residual) in sas_end_task(). We used this method for the predecessor hw driver, and I think that we can revert to it. Much appreciated, John What about 32-byte CDs or things like Write Same? You're talking about VARIABLE_LENGTH_CMD (opcode 0x7f) for 32-byte CDs, right? Yes. .
[PATCH 2/2] scsi: esas2r: Replace semaphore fs_api_semaphore with mutex
The semaphore 'fs_api_semaphore' is used as a simple mutex, so it should be written as one. Semaphores are going away in the future. Signed-off-by: Binoy Jayan--- drivers/scsi/esas2r/esas2r.h | 2 +- drivers/scsi/esas2r/esas2r_init.c | 2 +- drivers/scsi/esas2r/esas2r_ioctl.c | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/scsi/esas2r/esas2r.h b/drivers/scsi/esas2r/esas2r.h index c5013de..1da6407 100644 --- a/drivers/scsi/esas2r/esas2r.h +++ b/drivers/scsi/esas2r/esas2r.h @@ -946,7 +946,7 @@ struct esas2r_adapter { struct esas2r_mem_desc *vrq_mds; int num_vrqs; struct mutex fm_api_mutex; - struct semaphore fs_api_semaphore; + struct mutex fs_api_mutex; struct semaphore nvram_semaphore; struct atto_ioctl *local_atto_ioctl; u8 fw_coredump_buff[ESAS2R_FWCOREDUMP_SZ]; diff --git a/drivers/scsi/esas2r/esas2r_init.c b/drivers/scsi/esas2r/esas2r_init.c index ad85b33..5b14dd2 100644 --- a/drivers/scsi/esas2r/esas2r_init.c +++ b/drivers/scsi/esas2r/esas2r_init.c @@ -328,7 +328,7 @@ int esas2r_init_adapter(struct Scsi_Host *host, struct pci_dev *pcid, spin_lock_init(>request_lock); spin_lock_init(>fw_event_lock); mutex_init(>fm_api_mutex); - sema_init(>fs_api_semaphore, 1); + mutex_init(>fs_api_mutex); sema_init(>nvram_semaphore, 1); esas2r_fw_event_off(a); diff --git a/drivers/scsi/esas2r/esas2r_ioctl.c b/drivers/scsi/esas2r/esas2r_ioctl.c index c6b041a..9762300 100644 --- a/drivers/scsi/esas2r/esas2r_ioctl.c +++ b/drivers/scsi/esas2r/esas2r_ioctl.c @@ -1962,7 +1962,7 @@ int esas2r_read_fs(struct esas2r_adapter *a, char *buf, long off, int count) (struct esas2r_ioctl_fs *)a->fs_api_buffer; /* If another flash request is already in progress, return. */ - if (down_interruptible(>fs_api_semaphore)) { + if (mutex_lock_interruptible(>fs_api_mutex)) { busy: fs->status = ATTO_STS_OUT_OF_RSRC; return -EBUSY; @@ -1978,7 +1978,7 @@ int esas2r_read_fs(struct esas2r_adapter *a, char *buf, long off, int count) rq = esas2r_alloc_request(a); if (rq == NULL) { esas2r_debug("esas2r_read_fs: out of requests"); - up(>fs_api_semaphore); + mutex_unlock(>fs_api_mutex); goto busy; } @@ -2006,7 +2006,7 @@ int esas2r_read_fs(struct esas2r_adapter *a, char *buf, long off, int count) ; dont_wait: /* Free the request and keep going */ - up(>fs_api_semaphore); + mutex_unlock(>fs_api_mutex); esas2r_free_request(a, (struct esas2r_request *)rq); /* Pick up possible error code from above */ -- Binoy Jayan
[PATCH 0/2] esas2r: Replace semaphores with mutexes
These are a set of patches which removes semaphores from esas2r. These are part of a bigger effort to eliminate unwanted semaphores from the linux kernel. Binoy Jayan (2): scsi: esas2r: Replace semaphore fm_api_semaphore with mutex scsi: esas2r: Replace semaphore fs_api_semaphore with mutex drivers/scsi/esas2r/esas2r.h | 4 ++-- drivers/scsi/esas2r/esas2r_init.c | 4 ++-- drivers/scsi/esas2r/esas2r_ioctl.c | 10 +- 3 files changed, 9 insertions(+), 9 deletions(-) -- Binoy Jayan
[PATCH 1/2] scsi: esas2r: Replace semaphore fm_api_semaphore with mutex
The semaphore 'fm_api_semaphore' is used as a simple mutex, so it should be written as one. Semaphores are going away in the future. Signed-off-by: Binoy Jayan--- drivers/scsi/esas2r/esas2r.h | 2 +- drivers/scsi/esas2r/esas2r_init.c | 2 +- drivers/scsi/esas2r/esas2r_ioctl.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/scsi/esas2r/esas2r.h b/drivers/scsi/esas2r/esas2r.h index b6030e3..c5013de 100644 --- a/drivers/scsi/esas2r/esas2r.h +++ b/drivers/scsi/esas2r/esas2r.h @@ -945,7 +945,7 @@ struct esas2r_adapter { struct list_head vrq_mds_head; struct esas2r_mem_desc *vrq_mds; int num_vrqs; - struct semaphore fm_api_semaphore; + struct mutex fm_api_mutex; struct semaphore fs_api_semaphore; struct semaphore nvram_semaphore; struct atto_ioctl *local_atto_ioctl; diff --git a/drivers/scsi/esas2r/esas2r_init.c b/drivers/scsi/esas2r/esas2r_init.c index 6432a50..ad85b33 100644 --- a/drivers/scsi/esas2r/esas2r_init.c +++ b/drivers/scsi/esas2r/esas2r_init.c @@ -327,7 +327,7 @@ int esas2r_init_adapter(struct Scsi_Host *host, struct pci_dev *pcid, esas2r_debug("new adapter %p, name %s", a, a->name); spin_lock_init(>request_lock); spin_lock_init(>fw_event_lock); - sema_init(>fm_api_semaphore, 1); + mutex_init(>fm_api_mutex); sema_init(>fs_api_semaphore, 1); sema_init(>nvram_semaphore, 1); diff --git a/drivers/scsi/esas2r/esas2r_ioctl.c b/drivers/scsi/esas2r/esas2r_ioctl.c index 2d4b7f0..c6b041a 100644 --- a/drivers/scsi/esas2r/esas2r_ioctl.c +++ b/drivers/scsi/esas2r/esas2r_ioctl.c @@ -110,7 +110,7 @@ static void do_fm_api(struct esas2r_adapter *a, struct esas2r_flash_img *fi) { struct esas2r_request *rq; - if (down_interruptible(>fm_api_semaphore)) { + if (mutex_lock_interruptible(>fm_api_mutex)) { fi->status = FI_STAT_BUSY; return; } @@ -173,7 +173,7 @@ static void do_fm_api(struct esas2r_adapter *a, struct esas2r_flash_img *fi) free_req: esas2r_free_request(a, (struct esas2r_request *)rq); free_sem: - up(>fm_api_semaphore); + mutex_unlock(>fm_api_mutex); return; } -- Binoy Jayan
Re: [PATCH V4 2/2] scsi: ufshcd-pci: Add Intel CNL support
Hello to all, Às 2:16 PM de 6/7/2017, Christoph Hellwig escreveu: > On Tue, Jun 06, 2017 at 02:35:31PM +0300, Adrian Hunter wrote: >> Add PCI id and variant ops for Intel CNL UFS host controller. > > Looks good: > > Reviewed-by: Christoph Hellwig> > It would be great if we could fold tc-dwc-g210-pci into ufshcd-pci the > same way. > I have forward the suggestion to the person on charge of UFS driver maintenance at Synopsys. We will definitely have a look at it! Thanks, Joao
[PATCH 2/7] scsi: ibmvscsi_tgt: remove use of class_attrs
The class_attrs pointer is going away and it's not even being used in this driver, so just remove it entirely. Cc: "Bryant G. Ly"Cc: Michael Cyr Cc: "James E.J. Bottomley" Cc: "Martin K. Petersen" Cc: Cc: Signed-off-by: Greg Kroah-Hartman --- drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c | 5 - 1 file changed, 5 deletions(-) diff --git a/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c b/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c index d390325c99ec..b480878e3258 100644 --- a/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c +++ b/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c @@ -3915,10 +3915,6 @@ static const struct target_core_fabric_ops ibmvscsis_ops = { static void ibmvscsis_dev_release(struct device *dev) {}; -static struct class_attribute ibmvscsis_class_attrs[] = { - __ATTR_NULL, -}; - static struct device_attribute dev_attr_system_id = __ATTR(system_id, S_IRUGO, system_id_show, NULL); @@ -3938,7 +3934,6 @@ ATTRIBUTE_GROUPS(ibmvscsis_dev); static struct class ibmvscsis_class = { .name = "ibmvscsis", .dev_release= ibmvscsis_dev_release, - .class_attrs= ibmvscsis_class_attrs, .dev_groups = ibmvscsis_dev_groups, }; -- 2.13.1
Re: [PATCH v3 14/23] scsi: hisi_sas: add v3 cq interrupt handler
Hi John, sorry for dropping the ball, but your repost reminded me. On Thu, Jun 01, 2017 at 11:36:55AM +0100, John Garry wrote: > In the command completion code we need to check for abnormal completion due > to underflow, but ignore it when it occurs in some commands, like inquiry. > This is why we check for rw command - it is equivalent to !inquiry. > > I'll see if we can change the check to explicitly ignore certain commands > which complete abnormally with underflow. In general it should be up to the higher level and not the driver to detect underflow, and that's how most (hopefully all, but I won't bet on some older ones) of our drivers operate. > > > What about 32-byte CDs or things like Write Same? > > > > You're talking about VARIABLE_LENGTH_CMD (opcode 0x7f) for 32-byte CDs, > right? Yes.
Re: [PATCH] configfs: Fix race between create_link and configfs_rmdir
Thanks Nic, applied to the configfs-for-next tree. I'm not entirely sure if we should bother adding this to 4.12 or if it hits rarely enough?