]> git.baikalelectronics.ru Git - kernel.git/commit
s390/con3270: fix insufficient space padding
authorSascha Silbe <silbe@linux.vnet.ibm.com>
Tue, 20 Sep 2016 17:09:07 +0000 (19:09 +0200)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Fri, 30 Sep 2016 07:13:21 +0000 (09:13 +0200)
commitaee9ea0726a01f909083d6344a20e39c283919c1
treeffa2d2d89c8770097c0a840d8d314dfca2d67b7a
parente060bd00804d027b6a2123a4dba893ad958fa6d4
s390/con3270: fix insufficient space padding

con3270 contains an optimisation that reduces the amount of data to be
transmitted to the 3270 terminal by putting a Repeat to Address (RA)
order into the data stream. The RA order itself takes up space, so
con3270 only uses it if there's enough space left in the line
buffer. Otherwise it just pads out the line manually.

For lines that were _just_ short enough that the RA order still fit in
the line buffer, the line was instead padded with an insufficient
amount of spaces. This was caused by examining the size of the
allocated line buffer rather than the length of the string to be
displayed.

For con3270_cline_end(), we just compare against the line length. For
con3270_update_string() however that isn't available anymore, so we
check whether the Repeat to Address order is present.

Fixes: f51320a5 ("[PATCH] s390: new 3270 driver.") (tglx/history.git)
Tested-by: Jing Liu <liujbjl@linux.vnet.ibm.com>
Tested-by: Yang Chen <bjcyang@linux.vnet.ibm.com>
Signed-off-by: Sascha Silbe <silbe@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
drivers/s390/char/con3270.c