mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Jörn Engel" <joern@wohnheim.fh-wedel.de>
To: Andrew Morton <akpm@osdl.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/3] copyfile: generic_sendpage
Date: Mon, 6 Sep 2004 13:54:28 +0200	[thread overview]
Message-ID: <20040906115428.GA25429@wohnheim.fh-wedel.de> (raw)
In-Reply-To: <20040904153902.6ac075ea.akpm@osdl.org>

On Sat, 4 September 2004 15:39:02 -0700, Andrew Morton wrote:
> Jörn Engel <joern@wohnheim.fh-wedel.de> wrote:
> >
> > o Add sendfile() support for file targets to normal mm/filemap.c.
> 
> This comes up fairly regularly.  See, for example,
> http://lwn.net/Articles/88751/ for what appears to be a much simpler
> implementation.

Yes, I saw it and commented on it.  Al didn't seem to like the set_fs
very much, so that specific implementation appears to be dead.

> I discussed file->file sendfile with Linus a while back and he said
> 
> > I think it was about doing a 2GB file-file sendfile, and see your system
> > grind to a halt without being able to kill it.
> > 
> > That said, we have some of the same problems with just regular read/write 
> > too. sendfile just makes it easier.
> > 
> > We should probably make read/write be interruptible by _fatal_ signals.  
> > It would require a new task state, though (TASK_KILLABLE or something, and
> > it would show up as a normal 'D' state).
> 
> I don't know how much of a problem this is in practice - there are all
> sorts of nasty things which unprivileged apps can do to the system by
> overloading filesystems.  Although most of them can be killed off by the
> sysadmin.
>
> (My infamous bash-shared-mappings stresstest can spend ten or more minutes
> within a single write() call, but you have to try hard to do this).

Sure, a 2GB copyfile(2) is nasty (sendfile can at least return a short
count), esp. with slow media like a usb1 attached hard drive.  Might
be a reasonable short-term solution to return -EFBIG whenever a user
tries to copy a file >$PRETTY_LARGE and doesn't have CAP_WHATNOT.

Would you accept such a solution?  And if you would, which magic
constants should I use?

Jörn

-- 
When you close your hand, you own nothing. When you open it up, you
own the whole world.
-- Li Mu Bai in Tiger & Dragon

  parent reply	other threads:[~2004-09-06 11:54 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-04 16:57 Jörn Engel
2004-09-04 16:59 ` [PATCH 2/3] copyfile: sendfile Jörn Engel
2004-09-04 17:04   ` [PATCH 3/3] copyfile: copyfile Jörn Engel
2004-09-04 17:08     ` Jörn Engel
2004-09-04 17:11   ` [PATCH 2/3] copyfile: sendfile Christoph Hellwig
2004-09-04 17:16     ` Jörn Engel
2004-09-04 17:12 ` [PATCH 1/3] copyfile: generic_sendpage Christoph Hellwig
2004-09-04 17:22   ` Jörn Engel
2004-09-04 17:25     ` Christoph Hellwig
2004-09-07  8:32       ` Jan Blunck
2004-09-04 22:39 ` Andrew Morton
2004-09-05  0:16   ` William Lee Irwin III
2004-09-05  0:23     ` Andrew Morton
2004-09-06 11:54   ` Jörn Engel [this message]
2004-09-06 12:45   ` Gunnar Ritter
2004-09-06 13:35     ` Jörn Engel
2004-09-06 14:32       ` Gunnar Ritter
2004-09-06 14:46         ` Oliver Neukum
2004-09-06 15:51           ` Gunnar Ritter
2004-09-07 11:09         ` Jörn Engel
2004-09-07 11:45           ` Jörn Engel
2004-09-07 12:03             ` Gunnar Ritter
2004-09-07 12:08               ` Jörn Engel
2004-09-07 12:32                 ` Gunnar Ritter
2004-09-07 11:48           ` Gunnar Ritter
2004-09-07 12:04             ` Jörn Engel

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=20040906115428.GA25429@wohnheim.fh-wedel.de \
    --to=joern@wohnheim.fh-wedel.de \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®