Discussion:
Referrals and lba_map
Sebastian Herbszt
2014-08-29 23:15:54 UTC
Permalink
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

Sebastian
Nicholas A. Bellinger
2014-09-17 17:46:21 UTC
Permalink
Hi Sebastian,
Post by Sebastian Herbszt
Hello,
the cover letter for "TCM Referrals support" [1] describes the map format for
<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.

Thanks,

--nab
Hannes Reinecke
2014-09-18 06:33:07 UTC
Permalink
Post by Nicholas A. Bellinger
Hi Sebastian,
Post by Sebastian Herbszt
Hello,
the cover letter for "TCM Referrals support" [1] describes the map f=
ormat for
Post by Nicholas A. Bellinger
Post by Sebastian Herbszt
<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 a=
t once,
Post by Nicholas A. Bellinger
Post by Sebastian Herbszt
but line by line, so this does not work (anymore?). What am I missin=
g?
Post by Nicholas A. Bellinger
Post by Sebastian Herbszt
It seems to work if I change the delimiter from "\n" to ";" and put =
the whole
Post by Nicholas A. Bellinger
Post by Sebastian Herbszt
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
Post by Nicholas A. Bellinger
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 newli=
ne.
You might run into issues where the configfs stuff might be
treating the newline as an implicit EOF, thus reading only the first=20
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
--=20
Dr. Hannes Reinecke zSeries & Storage
***@suse.de +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=C3=BCrnberg
GF: J. Hawn, J. Guild, F. Imend=C3=B6rffer, HRB 16746 (AG N=C3=BCrnberg=
)
Sebastian Herbszt
2014-09-19 11:23:03 UTC
Permalink
Post by Nicholas A. Bellinger
Hi Sebastian,
Post by Sebastian Herbszt
Hello,
the cover letter for "TCM Referrals support" [1] describes the map format for
<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

Loading...