Re: [PATCH] sendfile removal
- From: "H. Peter Anvin" <hpa@xxxxxxxxx>
- Date: Thu, 31 May 2007 21:09:19 -0700
Jens Axboe wrote:
- retval = in_file->f_op->sendfile(in_file, ppos, count, file_send_actor, out_file);I like this, but are you sure it wont break user land ?
+ fl = 0;
+ if (in_file->f_flags & O_NONBLOCK)
+ fl = SPLICE_F_NONBLOCK;
+
+ retval = do_splice_direct(in_file, ppos, out_file, count, fl);
Some applications might react badly if sendfile() returns EAGAIN ?
Yeah, I didn't actually intend for that to sneak in. I'd think that
userspace should handle it if they opened the file O_NONBLOCK (or used
fcntl()), but it's a change in behaviour none the less and probably not
a good idea.
I would personally argue that sendfile() blocking on an O_NONBLOCK
desriptor, as opposed to returning EAGAIN, is a bug, and a fairly
serious such.
-hpa
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
- Follow-Ups:
- Re: [PATCH] sendfile removal
- From: Jens Axboe
- Re: [PATCH] sendfile removal
- Prev by Date: Re: [PATCH] Input: document the proper usage of EV_KEY and KEY_UNKNOWN
- Next by Date: [PATCH] slab: Fix slab debug for non alien caches.
- Previous by thread: Re: [dm-devel] Re: [RFD] BIO_RW_BARRIER - what it means for devices, filesystems, and dm/md.
- Next by thread: Re: [PATCH] sendfile removal
- Index(es):
Relevant Pages
|