Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760153Ab2HJDWp (ORCPT ); Thu, 9 Aug 2012 23:22:45 -0400 Received: from mail-wg0-f44.google.com ([74.125.82.44]:34845 "EHLO mail-wg0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752120Ab2HJDWn (ORCPT ); Thu, 9 Aug 2012 23:22:43 -0400 MIME-Version: 1.0 Date: Fri, 10 Aug 2012 12:22:41 +0900 Message-ID: Subject: [PATCH][SCSI] remove the queue unlock in scsi_requset_fn From: Chanho Min To: James Bottomley Cc: Mike Christie , linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, Jens Axboe , Tejun Heo , Bart Van Assche Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1281 Lines: 35 We don't need to unlock the queue before put_device in scsi_request_fn() If we trigger the ->remove() function, It occur a oops from the caller. So sdev reference count should not be dropped to zero here. Also It was added before scsi_device_dev_release() was moved to user context, so it is outdated. Signed-off-by: Chanho Min Reviewed-by: Bart Van Assche --- drivers/scsi/scsi_lib.c | 4 ---- 1 files changed, 0 insertions(+), 4 deletions(-) diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index ffd7773..cb2185a 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -1626,11 +1626,7 @@ out_delay: if (sdev->device_busy == 0) blk_delay_queue(q, SCSI_QUEUE_DELAY); out: - /* must be careful here...if we trigger the ->remove() function - * we cannot be holding the q lock */ - spin_unlock_irq(q->queue_lock); put_device(&sdev->sdev_gendev); - spin_lock_irq(q->queue_lock); } u64 scsi_calculate_bounce_limit(struct Scsi_Host *shost) -- 1.7.0.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/