From: Linus Torvalds <torvalds@linux-foundation.org>
To: Rick Jones <rick.jones2@hp.com>
Cc: Dan Rosenberg <drosenberg@vsecurity.com>,
David Miller <davem@davemloft.net>,
netdev@vger.kernel.org, jon.maloy@ericsson.com,
allan.stephens@windriver.com, Al Viro <viro@zeniv.linux.org.uk>
Subject: Re: [PATCH] net: Limit socket I/O iovec total length to INT_MAX.
Date: Fri, 29 Oct 2010 11:59:48 -0700 [thread overview]
Message-ID: <AANLkTinCD-A18cCV4FH1Q4oiOvfdsCTgLr6EXd17Rggi@mail.gmail.com> (raw)
In-Reply-To: <4CCB17B7.1010908@hp.com>
On Fri, Oct 29, 2010 at 11:51 AM, Rick Jones <rick.jones2@hp.com> wrote:
> It may be but a paint splatter on the bikeshed, or considered a case of
> "Doctor! Doctor! It hurts when I do this" "Then don't do that!" but
> elsewhere (not in the context of Linux) I've seen mention made of ISV
> software posting some particularly large receives and such - one case I saw
> was over 1GB, where that was tied to the size of a log buffer the creation
> of which I believe was not limited to ~INT_MAX by the application software.
Sure. And that is why I very much don't think it's a good idea to
disallow large reads or writes. Returning an error would be bad,
because it's not entirely unreasonable for some user to just have a
really big object (presumably for unrelated reasons), and do IO on it
in one go.
But expecting anybody to _fill_ that really big object in one go is
unreasonable. Even for regular files, anybody who has ever worked with
NFS and interruptible mounts knows that they have to be able to handle
partial IO. And with non-files you obviously have that all the time.
So I think it's perfectly fine to do a terabyte read() or write(). The
fact that the kernel will then internally limit it, and won't ever
actually then write more than 2GB-1 at a time ends up being just an
"implementation issue" that happens to protect the kernel against
subsystems that happen to have issues.
And an application that cannot handle partial reads or writes, yet
works with gigabyte+ data sets is _not_ an application that I consider
reasonable. That's a user space bug, pure and simple, and no amount of
"but but ..." makes any difference what-so-ever.
Linus
prev parent reply other threads:[~2010-10-29 19:00 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-28 18:22 [PATCH] net: Limit socket I/O iovec total length to INT_MAX David Miller
2010-10-28 18:33 ` Linus Torvalds
2010-10-28 18:37 ` David Miller
2010-10-29 6:40 ` Linus Torvalds
2010-10-29 14:00 ` Dan Rosenberg
2010-10-29 15:28 ` Linus Torvalds
2010-10-29 16:21 ` Linus Torvalds
2010-10-29 16:45 ` Al Viro
2010-10-29 17:01 ` Linus Torvalds
2010-10-29 17:32 ` Al Viro
2010-10-29 19:32 ` David Miller
2010-10-29 19:37 ` Linus Torvalds
2010-10-29 19:55 ` David Miller
2010-10-29 20:22 ` Dan Rosenberg
2010-10-29 18:51 ` Rick Jones
2010-10-29 18:59 ` Linus Torvalds [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=AANLkTinCD-A18cCV4FH1Q4oiOvfdsCTgLr6EXd17Rggi@mail.gmail.com \
--to=torvalds@linux-foundation.org \
--cc=allan.stephens@windriver.com \
--cc=davem@davemloft.net \
--cc=drosenberg@vsecurity.com \
--cc=jon.maloy@ericsson.com \
--cc=netdev@vger.kernel.org \
--cc=rick.jones2@hp.com \
--cc=viro@zeniv.linux.org.uk \
/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).