Message ID | 56A8A2A3.30407@suse.com (mailing list archive) |
---|---|
State | Not Applicable, archived |
Headers | show |
On Wed, 2016-01-27 at 11:57 +0100, Juergen Gross wrote: > On 27/01/16 07:28, Nicholas A. Bellinger wrote: > > On Tue, 2016-01-26 at 10:45 +0100, Juergen Gross wrote: > >> On 25/01/16 09:11, Nicholas A. Bellinger wrote: > >>> From: Nicholas Bellinger <nab@linux-iscsi.org> > >>> > >>> Cc: Juergen Gross <jgross@suse.com> > >>> Cc: Hannes Reinecke <hare@suse.de> > >>> Cc: David Vrabel <david.vrabel@citrix.com> > >>> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org> > >>> --- > >>> drivers/xen/xen-scsiback.c | 163 ++++++++++++++++++++++++--------------------- > >>> 1 file changed, 87 insertions(+), 76 deletions(-) > >>> > >>> diff --git a/drivers/xen/xen-scsiback.c b/drivers/xen/xen-scsiback.c > >>> index 594f8a7..640fb22 100644 > >>> --- a/drivers/xen/xen-scsiback.c > >>> +++ b/drivers/xen/xen-scsiback.c > >>> @@ -190,7 +190,6 @@ module_param_named(max_buffer_pages, scsiback_max_buffer_pages, int, 0644); > >>> MODULE_PARM_DESC(max_buffer_pages, > >>> "Maximum number of free pages to keep in backend buffer"); > >>> > >>> -static struct kmem_cache *scsiback_cachep; > >>> static DEFINE_SPINLOCK(free_pages_lock); > >>> static int free_pages_num; > >>> static LIST_HEAD(scsiback_free_pages); > >>> @@ -322,7 +321,8 @@ static void scsiback_free_translation_entry(struct kref *kref) > >>> } > >>> > >>> static void scsiback_do_resp_with_sense(char *sense_buffer, int32_t result, > >>> - uint32_t resid, struct vscsibk_pend *pending_req) > >>> + uint32_t resid, struct vscsibk_pend *pending_req, > >>> + uint16_t rqid) > >>> { > >>> struct vscsiif_response *ring_res; > >>> struct vscsibk_info *info = pending_req->info; > >> > >> pending_req might be NULL now, so this will panic the system. > >> > > > > Thanks for the review. > > > > Added the following to propagate up original *info into > > scsiback_do_resp_with_sense() to address the early pending_req > > failure case. > > > > https://git.kernel.org/cgit/linux/kernel/git/nab/target-pending.git/commit/?h=queue-next&id=5873f22a9b7c7aa16ff9a85074a07b739f1d06a5 > > Hmm, wouldn't it make more sense to split scsiback_do_resp_with_sense() > into two functions now? Something like: > <SNIP> > And then call scsiback_send_response() directly in case pending_req > is NULL. > That makes alot more sense. Just updated the series in queue-next, and folded your change into the original patch. Thanks Juergen. -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" 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/xen/xen-scsiback.c b/drivers/xen/xen-scsiback.c index ad4eb10..0d71467 100644 --- a/drivers/xen/xen-scsiback.c +++ b/drivers/xen/xen-scsiback.c @@ -321,11 +321,10 @@ static void scsiback_free_translation_entry(struct kref *kref) kfree(entry); } -static void scsiback_do_resp_with_sense(char *sense_buffer, int32_t result, - uint32_t resid, struct vscsibk_pend *pending_req) +static void scsiback_send_response(struct vscsibk_info *info, + char *sense_buffer, int32_t result, uint32_t resid, uint16_t rqid) { struct vscsiif_response *ring_res; - struct vscsibk_info *info = pending_req->info; int notify; struct scsi_sense_hdr sshdr;