git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Torsten Bögershausen" <tboegi@web.de>
To: Joachim Schmitz <jojo@schmitz-digital.de>, git@vger.kernel.org
Subject: Re: read()  MAX_IO_SIZE bytes, more than SSIZE_MAX?
Date: Sat, 07 Feb 2015 21:32:34 +0100	[thread overview]
Message-ID: <54D67662.7040504@web.de> (raw)
In-Reply-To: <loom.20150207T182443-33@post.gmane.org>

On 2015-02-07 18.29, Joachim Schmitz wrote:
> Torsten Bögershausen <tboegi <at> web.de> writes:
> 
>>
>> On 2015-02-07 17.45, Joachim Schmitz wrote:
> <snip>
>>
>> How about changing wrapper.c like this:
>>
>> #ifndef MAX_IO_SIZE
>>  #define MAX_IO_SIZE (8*1024*1024)
>> #endif
>> ---------------------
>> and to change config.mak.uname like this:
>>
>> ifeq ($(uname_S),NONSTOP_KERNEL)
>>
>> 	BASIC_CFLAGS += -DMAX_IO_SIZE=(32*1024)
>> Does this work for you ?
> 
> Of course it would, but, 
> a) 32k is smaller than we can go (and yes, we could make it 52k)
Sorry, I missed that:  (52*1024)
> b) never ever should read() be asked to read more than SSIZE_MAX, this  
> should be true for every platform on the planet? You may want to have is 
> smaller than SSIZE_MAX (like the current 8MB vs. the possible 2TB on 
> Linux), but surely never larger?
> 
Good question.
I don't know every platform of the planet well enough to be helpful here,
especially the ones which don't follow all the specifications.

In other words: As long as we can not guarantee that SSIZE_MAX is defined,
(and is defined to somethong useful for xread()/xwrite() )
we should be more defensive here:

tweak only on platform where we know it is needed and we know that it works.

And leave the other ones alone, until someone finds another
platform which needs the same or another tweak and sends a tested patch.


Thanks for the report, do you want to send a patch to the list ?

  parent reply	other threads:[~2015-02-07 20:32 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-07 16:45 read() MAX_IO_SIZE bytes, more than SSIZE_MAX? Joachim Schmitz
2015-02-07 16:48 ` Joachim Schmitz
2015-02-07 17:19 ` Torsten Bögershausen
2015-02-07 17:29   ` Joachim Schmitz
2015-02-07 18:03     ` Joachim Schmitz
2015-02-07 20:32     ` Torsten Bögershausen [this message]
2015-02-07 22:13       ` Junio C Hamano
2015-02-07 22:31         ` Joachim Schmitz
2015-02-08  2:13           ` Junio C Hamano
2015-02-08  2:32             ` Randall S. Becker
2015-02-08 12:05             ` Joachim Schmitz
2015-02-08 17:09               ` Eric Sunshine
2015-02-11 21:13                 ` Junio C Hamano
2015-02-11 21:29                   ` Joachim Schmitz
2015-02-11 22:05                     ` Joachim Schmitz
2015-02-11 23:15                       ` Junio C Hamano
2015-02-07 18:06   ` Randall S. Becker
2015-02-07 18:20     ` Randall S. Becker
2015-02-07 18:36       ` Joachim Schmitz
2015-02-07 19:14 ` Joachim Schmitz
  -- strict thread matches above, loose matches on Subject: below --
2015-02-12  7:46 Joachim Schmitz

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=54D67662.7040504@web.de \
    --to=tboegi@web.de \
    --cc=git@vger.kernel.org \
    --cc=jojo@schmitz-digital.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).