[to-be-updated] sendfile-do-not-update-file-offset-of-non-lseekable-objects.patch removed from -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     Subject: sendfile: do not update file offset of non-lseek()able objects.
has been removed from the -mm tree.  Its filename was
     sendfile-do-not-update-file-offset-of-non-lseekable-objects.patch

This patch was dropped because an updated version will be merged

------------------------------------------------------
From: Tetsuo Handa <penguin-kernel@xxxxxxxxxxxxxxxxxxx>
Subject: sendfile: do not update file offset of non-lseek()able objects.

I tried to sendfile() a file which is larger than 4GB to a pipe (which is
the stdout of Apache's CGI program), and noticed that sendfile() fails
with EFBIG after 2GB is copied to stdout pipe.  This is because sendfile()
is updating file offset of the file descriptor of the pipe.

sendfile() should not update file offset if the file descriptor refers to
an non-lseek()able object.

Link: http://lkml.kernel.org/r/1497262469-7536-1-git-send-email-penguin-kernel@xxxxxxxxxxxxxxxxxxx
Signed-off-by: Tetsuo Handa <penguin-kernel@xxxxxxxxxxxxxxxxxxx>
Cc: Al Viro <viro@xxxxxxxxxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 fs/read_write.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff -puN fs/read_write.c~sendfile-do-not-update-file-offset-of-non-lseekable-objects fs/read_write.c
--- a/fs/read_write.c~sendfile-do-not-update-file-offset-of-non-lseekable-objects
+++ a/fs/read_write.c
@@ -1417,7 +1417,8 @@ static ssize_t do_sendfile(int out_fd, i
 		add_wchar(current, retval);
 		fsnotify_access(in.file);
 		fsnotify_modify(out.file);
-		out.file->f_pos = out_pos;
+		if (out.file->f_op->llseek != no_llseek)
+			out.file->f_pos = out_pos;
 		if (ppos)
 			*ppos = pos;
 		else
_

Patches currently in -mm which might be from penguin-kernel@xxxxxxxxxxxxxxxxxxx are


--
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux