Re: [PATCH 2/3] iscsi-target: iscsi: Fix exp_statsn handling to use iSCSI serial number arithmetic

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Nov 6, 2012 at 4:55 PM, Nicholas A. Bellinger
<nab@xxxxxxxxxxxxxxx> wrote:
> > -                 (cmd->stat_sn < exp_statsn)) {

> Is there an actual bug this patch fixes, or some initiator that expects
> ExpStatSN to be using SNA..?   (CC'ing mnc + hare)

Well, consider what happens with the original code as above.  stat_sn
is a u32, so on a connection that lasts a long time (though 4 billion
commands doesn't last that long at high IOPS), we'll eventually hit a
case where our stat_sn will wrap around from UINT_MAX to 0.  And when
that happens, if the initiator sends us an exp_stat_sn of UINT_MAX-1
or something, then the test above will spuriously succeed.

The iscsi spec talks about using mod(2**32) arithmetic for StatSN.  I
think what that means is that you have to take wraparound into
account.  Strictly speaking that doesn't necessarily mean SNA I guess,
but that seems to be the easiest way to deal with it.

 - R.
--
To unsubscribe from this list: send the line "unsubscribe target-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux SCSI]     [Kernel Newbies]     [Linux SCSI Target Infrastructure]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Device Mapper]

  Powered by Linux