Message ID | 1346443241-24844-5-git-send-email-dongsu.park@profitbricks.com (mailing list archive) |
---|---|
State | Awaiting Upstream |
Headers | show |
On 08/31/12 20:00, dongsu.park@profitbricks.com wrote: > diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c > index 1b274484..ba7bbfd 100644 > --- a/drivers/infiniband/ulp/srp/ib_srp.c > +++ b/drivers/infiniband/ulp/srp/ib_srp.c > @@ -647,9 +647,19 @@ static void srp_remove_work(struct work_struct *work) > > static void srp_rport_delete(struct srp_rport *rport) > { > - struct srp_target_port *target = rport->lld_data; > + struct srp_target_port *target; > + > + if (!rport->lld_data) { > + pr_warn("skipping srp_rport_delete. rport->lld_data=%p\n", > + rport->lld_data); > + return; > + } > + > + target = rport->lld_data; > > srp_queue_remove_work(target); > + > + rport->lld_data = NULL; > } > > /** > diff --git a/drivers/scsi/scsi_transport_srp.c b/drivers/scsi/scsi_transport_srp.c > index af3cb56..915b355 100644 > --- a/drivers/scsi/scsi_transport_srp.c > +++ b/drivers/scsi/scsi_transport_srp.c > @@ -272,6 +272,12 @@ static void rport_dev_loss_timedout(struct work_struct *work) > struct Scsi_Host *shost; > struct srp_internal *i; > > + if (!rport->lld_data) { > + pr_warn("skipping rport_delete, rport->lld_data=%p\n", > + rport->lld_data); > + return; > + } > + > pr_err("SRP transport: dev_loss_tmo (%ds) expired - removing %s.\n", > rport->dev_loss_tmo, dev_name(&rport->dev)); > The above changes look harmless to me. But what I'd really like to know is whether the pr_warn() statements added by this patch have been hit after testing with patch [5/5] started ? The srp-ha patch series has been designed such that rport->lld_data != NULL as long as the rport data structure exists. Bart. -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c index 1b274484..ba7bbfd 100644 --- a/drivers/infiniband/ulp/srp/ib_srp.c +++ b/drivers/infiniband/ulp/srp/ib_srp.c @@ -647,9 +647,19 @@ static void srp_remove_work(struct work_struct *work) static void srp_rport_delete(struct srp_rport *rport) { - struct srp_target_port *target = rport->lld_data; + struct srp_target_port *target; + + if (!rport->lld_data) { + pr_warn("skipping srp_rport_delete. rport->lld_data=%p\n", + rport->lld_data); + return; + } + + target = rport->lld_data; srp_queue_remove_work(target); + + rport->lld_data = NULL; } /** diff --git a/drivers/scsi/scsi_transport_srp.c b/drivers/scsi/scsi_transport_srp.c index af3cb56..915b355 100644 --- a/drivers/scsi/scsi_transport_srp.c +++ b/drivers/scsi/scsi_transport_srp.c @@ -272,6 +272,12 @@ static void rport_dev_loss_timedout(struct work_struct *work) struct Scsi_Host *shost; struct srp_internal *i; + if (!rport->lld_data) { + pr_warn("skipping rport_delete, rport->lld_data=%p\n", + rport->lld_data); + return; + } + pr_err("SRP transport: dev_loss_tmo (%ds) expired - removing %s.\n", rport->dev_loss_tmo, dev_name(&rport->dev));