From: "Nicholas A. Bellinger" <nab@linux-iscsi.org>
To: Arne Redlich <arne.redlich@googlemail.com>
Cc: linux-kernel <linux-kernel@vger.kernel.org>,
linux-scsi <linux-scsi@vger.kernel.org>,
James Bottomley <James.Bottomley@hansenpartnership.com>,
Christoph Hellwig <hch@lst.de>,
Linus Torvalds <torvalds@linux-foundation.org>,
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>
Subject: Re: [PATCH-v3 13/14] iscsi-target: Add misc utility and debug logic
Date: Fri, 13 May 2011 16:32:25 -0700 [thread overview]
Message-ID: <1305329545.7102.53.camel@haakon2.linux-iscsi.org> (raw)
In-Reply-To: <BANLkTikMdAUjT=G+DHaJwDOXuh532uN8nw@mail.gmail.com>
On Fri, 2011-05-13 at 21:30 +0200, Arne Redlich wrote:
> 2011/5/12 Nicholas A. Bellinger <nab@linux-iscsi.org>:
> > From: Nicholas Bellinger <nab@linux-iscsi.org>
> >
> > This file adds iscsi_target_util.[c,h] code containing a number
> > of miscellaneous utility functions for iscsi_target_mod.
> >
> > It also contains iscsi_debug.h macros for CONFIG_ISCSI_TARGET_DEBUG
> >
> > Signed-off-by: Nicholas A. Bellinger <nab@linux-iscsi.org>
>
> <snip>
>
> > diff --git a/drivers/target/iscsi/iscsi_target_util.c b/drivers/target/iscsi/iscsi_target_util.c
> > new file mode 100644
> > index 0000000..af1c5c44
> > --- /dev/null
> > +++ b/drivers/target/iscsi/iscsi_target_util.c
>
> <snip>
>
> > +
> > +struct iscsi_r2t *iscsit_get_r2t_for_eos(
> > + struct iscsi_cmd *cmd,
> > + u32 offset,
> > + u32 length)
> > +{
> > + struct iscsi_r2t *r2t;
> > +
> > + spin_lock_bh(&cmd->r2t_lock);
> > + list_for_each_entry(r2t, &cmd->cmd_r2t_list, r2t_list) {
> > + if ((r2t->offset <= offset) &&
> > + (r2t->offset + r2t->xfer_len) >= (offset + length))
> > + break;
> > + }
> > + spin_unlock_bh(&cmd->r2t_lock);
> > +
> > + if (!r2t) {
> > + printk(KERN_ERR "Unable to locate R2T for Offset: %u, Length:"
> > + " %u\n", offset, length);
> > + return NULL;
> > + }
> > +
> > + return r2t;
> > +}
> > +
>
> Nicholas,
>
> This lookup pattern (repeated several times throughout the patch)
> looks seriously flawed to me as r2t will never be NULL.
>
Ugh..
Unfortuately this breakage was introduced during the v4 conversion of
iscsi-target to use struct list_head instead of the legacy raw ->next
pointers for list walking in about 10 different locations..
I have pushed the following commit into lio-core-2.6.git to address the
cases where a bogus NULL check of *pos after list_for_each_entry()
exists:
iscsi-target: Fix incorrect list_for_each_entry() NULL checks
http://git.kernel.org/?p=linux/kernel/git/nab/lio-core-2.6.git;a=commitdiff;h=af66a1368ec3256ba44656490688364084fa893d
Please review the changes in lio-core-2.6.git/lio-4.1 and let me know if
you see any more of these cases that need to be fixed, or have any
additional review comments.
So with that, I will go ahead and re-spin a proper PATCH-v4 series over
the weekend for James to merge with this patch, and hopefully one
additional v4.1 specific bugfix that is currently be investigated by
Martin.
Seriously, thanks for catching this one Arne..
Best Regards,
--nab
next prev parent reply other threads:[~2011-05-13 23:40 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-12 7:07 [PATCH-v3 00/14] iscsi-target: initial .40 drivers/target/iscsi merge Nicholas A. Bellinger
2011-05-12 7:07 ` [PATCH-v3 01/14] iscsi: Resolve iscsi_proto.h naming conflicts with drivers/target/iscsi Nicholas A. Bellinger
2011-05-12 7:07 ` [PATCH-v3 02/14] iscsi: Add Serial Number Arithmetic LT and GT into iscsi_proto.h Nicholas A. Bellinger
2011-05-12 7:07 ` [PATCH-v3 03/14] target: Convert REPORT_LUNs to use int_to_scsilun Nicholas A. Bellinger
2011-05-12 7:07 ` [PATCH-v3 04/14] iscsi-target: Add iSCSI fabric support for target v4 Nicholas A. Bellinger
2011-05-12 7:07 ` [PATCH-v3 05/14] iscsi-target: Add TCM v4 compatiable ConfigFS control plane Nicholas A. Bellinger
2011-05-12 7:07 ` [PATCH-v3 06/14] iscsi-target: Add configfs fabric dependent statistics Nicholas A. Bellinger
2011-05-12 7:07 ` [PATCH-v3 07/14] iscsi-target: Add TPG and Device logic Nicholas A. Bellinger
2011-05-12 7:07 ` [PATCH-v3 08/14] iscsi-target: Add iSCSI Login Negotiation + Parameter logic Nicholas A. Bellinger
2011-05-12 7:07 ` [PATCH-v3 09/14] iscsi-target: Add CHAP Authentication support using libcrypto Nicholas A. Bellinger
2011-05-12 7:07 ` [PATCH-v3 10/14] iscsi-target: Add Sequence/PDU list + DataIN response logic Nicholas A. Bellinger
2011-05-12 7:07 ` [PATCH-v3 11/14] iscsi-target: Add iSCSI Error Recovery Hierarchy support Nicholas A. Bellinger
2011-05-12 7:07 ` [PATCH-v3 12/14] iscsi-target: Add support for task management operations Nicholas A. Bellinger
2011-05-12 7:07 ` [PATCH-v3 13/14] iscsi-target: Add misc utility and debug logic Nicholas A. Bellinger
2011-05-13 19:30 ` Arne Redlich
2011-05-13 23:32 ` Nicholas A. Bellinger [this message]
2011-05-12 7:07 ` [PATCH-v3 14/14] iscsi-target: Add Makefile/Kconfig and update TCM top level Nicholas A. Bellinger
2011-05-12 15:13 ` Randy Dunlap
2011-05-12 20:04 ` 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=1305329545.7102.53.camel@haakon2.linux-iscsi.org \
--to=nab@linux-iscsi.org \
--cc=James.Bottomley@hansenpartnership.com \
--cc=agrover@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=arne.redlich@googlemail.com \
--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 \
--cc=torvalds@linux-foundation.org \
/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
all inboxes | Powered by JetHome®