From 19d462065fec52b9e697ef64a8e4b61dfd452316 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Sun, 6 Jan 2013 19:11:41 +0000 Subject: [PATCH] scst: Make scst_set_io_context() save the old I/O context (merge r4214 from trunk) git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/2.2.x@4722 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/src/scst_priv.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scst/src/scst_priv.h b/scst/src/scst_priv.h index 235ded3c7..8269b5259 100644 --- a/scst/src/scst_priv.h +++ b/scst/src/scst_priv.h @@ -198,6 +198,8 @@ static inline bool scst_set_io_context(struct scst_cmd *cmd, { bool res; + EXTRACHECKS_BUG_ON(old == NULL); + #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 25) return false; #endif @@ -212,6 +214,7 @@ static inline bool scst_set_io_context(struct scst_cmd *cmd, * No need for any ref counting action, because io_context * supposed to be cleared in the end of the caller function. */ + *old = current->io_context; current->io_context = cmd->tgt_dev->async_io_context; res = true; TRACE_DBG("io_context %p (tgt_dev %p)", current->io_context,