FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian Kernel

 
 
LinkBack Thread Tools
 
Old 05-09-2008, 02:42 PM
Laszlo Bako-Szabo
 
Default Bug#480354: sendfile support missing in aufs

Package: linux-image-2.6.24-1-amd64
Severity: important


aufs no longer has the sendfile capability, which seems to be
because the kernel is missing a patch, that is needed for 2.6.23+ kernels.
( http://aufs.cvs.sourceforge.net/aufs/aufs/patch/splice-2.6.23.patch?view=markup )
The function returns with 'Invalid argument' if I try to use it
on an aufs filesystem. The last working kernel is 2.6.22-3.

Tests were made with lighttpd and a small test program (attached).


-- Package-specific info:

-- System Information:
Debian Release: lenny/sid
APT prefers testing
APT policy: (990, 'testing'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.22-3-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
 
Old 05-09-2008, 05:15 PM
Julian Andres Klode
 
Default Bug#480354: sendfile support missing in aufs

On Fri, May 09, 2008 at 05:42:20PM +0300, Laszlo Bako-Szabo wrote:
> Package: linux-image-2.6.24-1-amd64
> Severity: important
>
>
> aufs no longer has the sendfile capability, which seems to be
> because the kernel is missing a patch, that is needed for 2.6.23+ kernels.
> ( http://aufs.cvs.sourceforge.net/aufs/aufs/patch/splice-2.6.23.patch?view=markup )
> The function returns with 'Invalid argument' if I try to use it
> on an aufs filesystem. The last working kernel is 2.6.22-3.
>
> Tests were made with lighttpd and a small test program (attached).
This bug has been fixed already in an upload of aufs (. Please use
module-assistant or wait for the next update of linux-modules-extra-2.6
built against the fixed aufs upload. (-486 and -686 kernels work
already)

>
>
> -- Package-specific info:
>
> -- System Information:
> Debian Release: lenny/sid
> APT prefers testing
> APT policy: (990, 'testing'), (500, 'stable')
> Architecture: amd64 (x86_64)
>
> Kernel: Linux 2.6.22-3-amd64 (SMP w/2 CPU cores)
> Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
> Shell: /bin/sh linked to /bin/bash

> /*
> * SENDFILE TEST
> *
> * mkdir -p /tmp/aufs /tmp/aufs1; echo "test" > /tmp/aufs1/test.txt; mount -t aufs none /tmp/aufs -o rw,br:/tmp/aufs1
> *
> * ./sendfile-test2 /tmp/aufs/test.txt
> *
> */
>
> #include <stdlib.h>
> #include <stdio.h>
> #include <string.h>
> #include <fcntl.h>
> #include <errno.h>
> #include <sys/sendfile.h>
> #include <sys/types.h>
> #include <sys/socket.h>
> #include <sys/stat.h>
> #include <netinet/in.h>
>
> int main(int argc, char **argv)
> {
> int port = 54321, sock_srv, sock_clnt, fd, addrlen;
> struct sockaddr_in addr; off_t offset = 0;
> char buf[1];
>
> if (argc!=2) { printf("Usage: %s <file-on-aufs>
", argv[0]); }
>
> if ( (sock_srv = socket(AF_INET, SOCK_DGRAM, 0)) == -1) { fprintf(stderr, "server socket error: %s
", strerror(errno)); exit(1); }
> memset(&addr, 0, sizeof(addr)); addr.sin_family = AF_INET; addr.sin_addr.s_addr = inet_addr("127.0.0.1"); addr.sin_port = htons(port);
> if ( bind(sock_srv, (struct sockaddr *)&addr, sizeof(addr)) == -1 ) { fprintf(stderr, "server bind error: %s
", strerror(errno)); exit(1); }
>
> if ( (sock_clnt = socket(AF_INET, SOCK_DGRAM, 0)) == -1) { fprintf(stderr, "client socket error: %s
", strerror(errno)); exit(1); }
> if ( connect(sock_clnt, (struct sockaddr *)&addr, sizeof(addr)) == -1 ) { fprintf(stderr, "client connect error: %s
", strerror(errno)); exit(1); }
>
> if ( (fd = open(argv[1], O_RDONLY)) == -1) { fprintf(stderr, "open error: %s
", strerror(errno)); exit(1); }
> offset = 0;
> if ( sendfile (sock_clnt, fd, &offset, 1) == -1) { fprintf(stderr, "sendfile error: %s
", strerror(errno)); exit(1); }
> if ( read(sock_srv, buf, 1) < 1 ) { fprintf(stderr, "read error: %s
", strerror(errno)); exit(1); }
> printf("sendfile seems OK!
");
> close(fd); close(sock_srv); close(sock_clnt); return 0;
> }
 

Thread Tools




All times are GMT. The time now is 08:56 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org