Re: Referrals and lba_map

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

 



Hannes Reinecke wrote:
> On 09/17/2014 07:46 PM, Nicholas A. Bellinger wrote:
> > Hi Sebastian,
> >
> > On Sat, 2014-08-30 at 01:15 +0200, Sebastian Herbszt wrote:
> >> Hello,
> >>
> >> the cover letter for "TCM Referrals support" [1] describes the map format for
> >> 'lba_map' as:
> >> <segment size> <segment multiplier>
> >> <start lba> <end lba> <pgX:stateY> ... <pgN:stateM>
> >> ...
> >>
> >> target_core_store_dev_lba_map() does not seem to get the whole map at once,
> >> but line by line, so this does not work (anymore?). What am I missing?
> >>
> >> It seems to work if I change the delimiter from "\n" to ";" and put the whole
> >> map on one line.
> >>
> >> [1] http://thread.gmane.org/gmane.linux.scsi/85530
> >>
> >
> > IIRC, this is done line-by-line because configfs (and sysfs as well)
> > attributes are limited to a single page sized payload, so attempting to
> > pass the entire map in one go when the length exceeds PAGE_SIZE won't
> > work given the existing limitation.
> >
> > Adding Hannes to the CC' again, as he's responsible for Referrals
> > support.
> >
> Hmm.
> 
> It did work for me at one point; even with the delimiter set to a newline.
> You might run into issues where the configfs stuff might be
> treating the newline as an implicit EOF, thus reading only the first 
> line. But in the end the newline is just for better readability;
> we can easily accept both newline and semicolon as line separator.
> 
> Cheers,
> 
> Hannes

The problem boils down to a difference between echo (coreutils-8.22)
and echo (bash-4.2 builtin). While the former issues one write, the
builtin echo command splits the input at '\n' and issues multiple
writes:

write(1, "3 2\n0 10 A\n", 11)           = 11

vs.

write(1, "3 2\n", 4)                    = 4
write(1, "0 10 A\n", 7)                 = 7


Sebastian
--
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