Re: [Vserver] sendfile in kernel 2.6.16r5 broken ?

From: Björn Steinbrink <B.Steinbrink_at_gmx.de>
Date: Wed 08 Mar 2006 - 15:26:09 GMT
Message-ID: <20060308152609.GA7000@atjola.homenet>

On 2006.03.08 15:18:06 +0100, gerardi wrote:
>
>
> Herbert Poetzl schrieb:
>
> >On Tue, Mar 07, 2006 at 05:37:11PM +0100, gerardi wrote:
> >
> >
> >>Hello everyone,
> >>
> >>Is the sendfile kernel option broken in 2.6.16rc5 or only together
> >>with vserver ?
> >>
> >>Wenn I am running kernel 2.6.16rc5 with the vserver patch vs2.1.1-rc10
> >>I have to deaktivate sendfile in Apache because it is broken.
> >>
> >>
> >
> >this sounds like a kernel bug, did you test with mainline
> >2.6.16-rc5 if it 'works' there? if so, please let me know
> >how it fails for you, as it then can be considered a bug
> >in the vserver code, which we'd like to fix asap ...
> >
> >
> >
> Ok I verified it. plain 2.6.16-rc5 is working but with vserver patch
> vs2.1.1-rc10 not.
>
> >>Are their other things to be broken in the dev version ?
> >>
> >>
> >
> >once we gain knowledge of 'broken' things, we try to fix
> >them as soon as possible .. so no 'known' broken things
> >there ...
> >
> >
> Nice to hear.

Could you try if this fixes the issue?

TIA
Björn

--
diff -NurpP --minimal linux-2.6.16-rc5-vs2.1.1-rc10/fs/read_write.c linux-2.6.16-rc5-vs2.1.1-rc10-sendfile/fs/read_write.c
--- linux-2.6.16-rc5-vs2.1.1-rc10/fs/read_write.c	2006-03-08 16:12:35.000000000 +0100
+++ linux-2.6.16-rc5-vs2.1.1-rc10-sendfile/fs/read_write.c	2006-03-08 16:22:15.000000000 +0100
@@ -657,8 +657,9 @@ ssize_t vfs_sendfile(struct file *out_fi
 			return -ESPIPE;
 
 	ret = rw_verify_area(FLOCK_VERIFY_READ, in_file, ppos, count);
-	if (ret)
+	if (ret < 0)
 		return ret;
+	count = ret;
 
 	/* verify out_file */
 	out_inode = out_file->f_dentry->d_inode;
@@ -668,8 +669,9 @@ ssize_t vfs_sendfile(struct file *out_fi
 		return -EINVAL;
 
 	ret = rw_verify_area(FLOCK_VERIFY_WRITE, out_file, &out_file->f_pos, count);
-	if (ret)
+	if (ret < 0)
 		return ret;
+	count = ret;
 
 	ret = security_file_permission (out_file, MAY_WRITE);
 	if (ret)
_______________________________________________
Vserver mailing list
Vserver@list.linux-vserver.org
http://list.linux-vserver.org/mailman/listinfo/vserver
Received on Wed Mar 8 15:25:38 2006
[Next/Previous Months] [Main vserver Project Homepage] [Howto Subscribe/Unsubscribe] [Paul Sladen's vserver stuff]
Generated on Wed 08 Mar 2006 - 15:25:43 GMT by hypermail 2.1.8