From: "Nicholas A. Bellinger" <nab@linux-iscsi.org>
To: linux-kernel <linux-kernel@vger.kernel.org>,
linux-scsi <linux-scsi@vger.kernel.org>,
James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: Christoph Hellwig <hch@lst.de>, Hannes Reinecke <hare@suse.de>,
FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>,
Andy Grover <agrover@redhat.com>,
Mike Christie <michaelc@cs.wisc.edu>,
Boaz Harrosh <bharrosh@panasas.com>,
Andrew Morton <akpm@linux-foundation.org>,
Martin Svec <martin.svec@zoner.cz>,
Nicholas Bellinger <nab@linux-iscsi.org>
Subject: [PATCH 4/6] target: Fix task->task_execute_queue=1 clear bug + LUN_RESET OOPs
Date: Thu, 19 May 2011 20:19:12 -0700 [thread overview]
Message-ID: <1305861554-29960-5-git-send-email-nab@linux-iscsi.org> (raw)
In-Reply-To: <1305861554-29960-1-git-send-email-nab@linux-iscsi.org>
From: Nicholas Bellinger <nab@linux-iscsi.org>
This patch fixes a bug where task->task_execute_queue=1 was not being
cleared once se_task had been removed from se_device->execute_task_list,
resulting in an OOPs in core_tmr_lun_reset() for the task->task_active=0
case where transport_remove_task_from_execute_queue() was incorrectly
being called.
This patch fixes two cases in transport_get_task_from_execute_queue()
and transport_remove_task_from_execute_queue() to properly clear
task->task_execute_queue=0 once list_del(&task->t_execute_list) has
been called.
It also adds an explict check in transport_remove_task_from_execute_queue()
to dump_stack + return if called with task->task_execute_queue=0.
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
---
drivers/target/target_core_transport.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c
index 3eeb3e2..beaf8fa 100644
--- a/drivers/target/target_core_transport.c
+++ b/drivers/target/target_core_transport.c
@@ -1194,6 +1194,7 @@ transport_get_task_from_execute_queue(struct se_device *dev)
break;
list_del(&task->t_execute_list);
+ atomic_set(&task->task_execute_queue, 0);
atomic_dec(&dev->execute_tasks);
return task;
@@ -1209,8 +1210,14 @@ void transport_remove_task_from_execute_queue(
{
unsigned long flags;
+ if (atomic_read(&task->task_execute_queue) == 0) {
+ dump_stack();
+ return;
+ }
+
spin_lock_irqsave(&dev->execute_task_lock, flags);
list_del(&task->t_execute_list);
+ atomic_set(&task->task_execute_queue, 0);
atomic_dec(&dev->execute_tasks);
spin_unlock_irqrestore(&dev->execute_task_lock, flags);
}
--
1.7.5.1
next prev parent reply other threads:[~2011-05-20 3:19 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-20 3:19 [PATCH 0/6] target: .40 bugfixes+changes (round 1) Nicholas A. Bellinger
2011-05-20 3:19 ` [PATCH 1/6] target: Fix multi task->task_sg[] chaining logic bug Nicholas A. Bellinger
2011-05-20 3:19 ` [PATCH 2/6] target: Fix interrupt context bug with stats_lock and core_tmr_alloc_req Nicholas A. Bellinger
2011-05-20 3:19 ` [PATCH 3/6] target: Fix bug with task_sg chained transport_free_dev_tasks release Nicholas A. Bellinger
2011-05-20 3:19 ` Nicholas A. Bellinger [this message]
2011-05-20 3:19 ` [PATCH 5/6] target: Convert REPORT_LUNs to use int_to_scsilun Nicholas A. Bellinger
2011-05-24 17:02 ` James Bottomley
2011-05-25 0:52 ` Nicholas A. Bellinger
2011-05-20 3:19 ` [PATCH 6/6] target: Convert TASK_ATTR to scsi_tcq.h definitions Nicholas A. Bellinger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1305861554-29960-5-git-send-email-nab@linux-iscsi.org \
--to=nab@linux-iscsi.org \
--cc=James.Bottomley@HansenPartnership.com \
--cc=agrover@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=bharrosh@panasas.com \
--cc=fujita.tomonori@lab.ntt.co.jp \
--cc=hare@suse.de \
--cc=hch@lst.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.svec@zoner.cz \
--cc=michaelc@cs.wisc.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).