]> git.karo-electronics.de Git - karo-tx-linux.git/commit
sendfile(): check f_op.splice_write() rather than f_op.sendpage()
authorChangli Gao <xiaosuo@gmail.com>
Wed, 4 Nov 2009 08:09:52 +0000 (09:09 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 2 Mar 2011 14:46:40 +0000 (09:46 -0500)
commit2d7b204f69587095283baf90779aeecc59ff6fff
treeecf0c69449aa2fb23bd1c8cc6bf0b51542075353
parent890650798af784a1d7944a762b787784077ed14f
sendfile(): check f_op.splice_write() rather than f_op.sendpage()

commit cc56f7de7f00d188c7c4da1e9861581853b9e92f upstream.

sendfile(2) was reworked with the splice infrastructure, but it still
checks f_op.sendpage() instead of f_op.splice_write() wrongly.  Although
if f_op.sendpage() exists, f_op.splice_write() always exists at the same
time currently, the assumption will be broken in future silently.  This
patch also brings a side effect: sendfile(2) can work with any output
file.  Some security checks related to f_op are added too.

Signed-off-by: Changli Gao <xiaosuo@gmail.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Cc: Przemyslaw Pawelczyk <przemyslaw@pawelczyk.it>
fs/read_write.c
fs/splice.c