[Stgt-devel] first burst > max burst

Pete Wyckoff pw
Mon Sep 17 16:41:02 CEST 2007

I've been tripping over this lately:

        if ((session->imm_data_en || !session->initial_r2t_en) &&
             session->first_burst > session->max_burst) {
                printk("iscsi: invalid burst lengths: "
                       "first_burst %d max_burst %d\n",
                       session->first_burst, session->max_burst);
                return -EINVAL;

when testing stock v2.6.23-rc6.  My previous kernel had that
code hacked out, somewhat accidentally.

The open-iscsi regression.dat has two blocks of 10 tests total that
will trigger this complaint.  It asks for FBL from 4k..128k, but MBL
of only 4k.

The spec tells us:

   FirstBurstLength MUST NOT exceed MaxBurstLength.

But stgt does not enforce this constraint.

What's your philosophy here?  The initiator is asking for something
that is not valid.  Negotiation happens with the target, which
merrily does the "minimum" dance for the two parameters separately, but
doesn't enforce the constraint.  Then finally in iscsi_conn_start(),
the initiator complains.  Do you think stgt should have code that
quietly decreases FirstBurstLength if it exceeds MaxBurstLength so
that the login will succeed?

I would have thought this was operator error, not a target
deficiency, but your commit ffd0436ed2e5a741c8d30062b489b989acf0a526
says in part:

    iSCSI RFC states that the first burst length must be smaller than the
    max burst length. We currently assume targets will be good, but that may
    not be the case, so this patch adds a check.

Whose job is it to be good here?

		-- Pete

More information about the stgt mailing list