All of lore.kernel.org
 help / color / mirror / Atom feed
From: Halil Pasic <pasic@linux.vnet.ibm.com>
To: "Collin L. Walling" <walling@linux.vnet.ibm.com>,
	Christian Borntraeger <borntraeger@de.ibm.com>,
	Cornelia Huck <cohuck@redhat.com>
Cc: Thomas Huth <thuth@redhat.com>,
	Bjoern Walk <bwalk@linux.vnet.ibm.com>,
	David Hildenbrand <david@redhat.com>,
	Pierre Morel <pmorel@linux.vnet.ibm.com>,
	qemu-devel <qemu-devel@nongnu.org>,
	Alexander Graf <agraf@suse.de>,
	"Jason J . Herne" <jjherne@linux.vnet.ibm.com>,
	Richard Henderson <rth@twiddle.net>
Subject: Re: [Qemu-devel] [PATCH] s390-ccw: print carriage return with new lines
Date: Thu, 26 Oct 2017 00:24:32 +0200	[thread overview]
Message-ID: <213b31a8-a485-1281-0fe3-493de8115957@linux.vnet.ibm.com> (raw)
In-Reply-To: <bbcf40e2-18a3-bffc-d97c-7dd410e239b7@linux.vnet.ibm.com>



On 10/25/2017 09:49 PM, Collin L. Walling wrote:
>>> -    sccb->h.length = sizeof(WriteEventData) + len;
>>> +    for (p = str; *p; ++p) {
>>> +        if (data_len > SCCB_DATA_LEN - 1) {
>>> +            return -EFBIG;
>>> +        }
>> We could also do a partial write or do more that one
>> sclp_service_call calls.
>>
>> I don't think EFBIG is entirely correct here. From the man page:
>> """
>>         EFBIG  An attempt was made to write a file that exceeds the implementa-
>>                tion-defined maximum file size or the process’s file size limit,
>>                or to write at a position past the maximum allowed offset.
>> """
>>
>> That's not what we have here IMHO.
> 
> 
> From my perspective, the error code was a tie between EFBIG (consider
> max sccb size as the maximum allowed offset) and ENOSPC:
> 
> 
> """
> ENOSPC The device containing the file referred to by /fd/has no room
> for the data.
> """
> 

From where I stand, the file behind the fd is the VT220 terminal you
talk to via sclp_service_call(SCLP_CMD_WRITE_EVENT_DATA, sccb) -- you
can check the AR).

In the end, the target scope (in sense of expected client
code) of this function very limited, and AFAIU does not necessarily
care about error codes (see sclp_print). So basically anything is fine
with me, because it does not really matter -- but just because it does
not really matter.

Halil
> 
> (consider "the file" as the sccb data buffer)
> 
> However, I extremely doubt we'll ever encounter an overflow from
> printing during the bios (why would we print something that large?)
> ... perhaps the check is redundant?


      reply	other threads:[~2017-10-25 22:24 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-20 10:25 [Qemu-devel] [PATCH] s390-ccw: print carriage return with new lines Christian Borntraeger
2017-10-20 10:30 ` Alexander Graf
2017-10-20 10:41   ` Christian Borntraeger
2017-10-20 11:02     ` Christian Borntraeger
2017-10-20 11:09       ` Alexander Graf
2017-10-20 11:18         ` Christian Borntraeger
2017-10-20 11:28       ` Thomas Huth
2017-10-20 13:48       ` Farhan Ali
2017-10-25  5:55         ` Christian Borntraeger
2017-10-20 11:31 ` Cornelia Huck
2017-10-20 12:27   ` Christian Borntraeger
2017-10-20 12:41     ` Cornelia Huck
2017-10-20 11:37 ` Halil Pasic
2017-10-25 19:49   ` Collin L. Walling
2017-10-25 22:24     ` Halil Pasic [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=213b31a8-a485-1281-0fe3-493de8115957@linux.vnet.ibm.com \
    --to=pasic@linux.vnet.ibm.com \
    --cc=agraf@suse.de \
    --cc=borntraeger@de.ibm.com \
    --cc=bwalk@linux.vnet.ibm.com \
    --cc=cohuck@redhat.com \
    --cc=david@redhat.com \
    --cc=jjherne@linux.vnet.ibm.com \
    --cc=pmorel@linux.vnet.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    --cc=thuth@redhat.com \
    --cc=walling@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.