lkml.org 
[lkml]   [2002]   [Sep]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: Early SPECWeb99 results on 2.5.33 with TSO on e1000
    David S. Miller wrote:
    > From: Jeff Garzik <jgarzik@mandrakesoft.com>
    > Date: Mon, 16 Sep 2002 19:48:37 -0400
    >
    > I dunno when it happened, but 2.5.x now returns EINVAL for all
    > file->file cases.
    >
    > In 2.4.x, if sendpage is NULL, file_send_actor in mm/filemap.c faked a
    > call to fops->write().
    > In 2.5.x, if sendpage is NULL, EINVAL is unconditionally returned.
    >
    >
    > What if source and destination file and offsets match?


    The same data is written out. No deadlock.
    (unless the attached test is wrong)

    Jeff


    #include <sys/sendfile.h>
    #include <unistd.h>
    #include <fcntl.h>
    #include <sys/types.h>
    #include <sys/stat.h>
    #include <string.h>
    #include <stdio.h>

    int main (int argc, char *argv[])
    {
    int in, out;
    struct stat st;
    off_t off = 0;
    ssize_t rc;

    in = open("test.data", O_RDONLY);
    if (in < 0) {
    perror("test.data read");
    return 1;
    }

    fstat(in, &st);

    out = open("test.data", O_WRONLY);
    if (out < 0) {
    perror("test.data write");
    return 1;
    }

    rc = sendfile(out, in, &off, st.st_size);
    if (rc < 0) {
    perror("sendfile");
    close(in);
    unlink("out");
    close(out);
    return 1;
    }

    close(in);
    close(out);
    return 0;
    }

    \
     
     \ /
      Last update: 2005-03-22 13:28    [W:0.028 / U:2.512 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site