lkml.org 
[lkml]   [2017]   [Dec]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Date
    Subject[PATCH 3.16 062/204] vfs: Return -ENXIO for negative SEEK_HOLE / SEEK_DATA offsets
    3.16.52-rc1 review patch.  If anyone has any objections, please let me know.

    ------------------

    From: Andreas Gruenbacher <agruenba@redhat.com>

    commit fc46820b27a2d9a46f7e90c9ceb4a64a1bc5fab8 upstream.

    In generic_file_llseek_size, return -ENXIO for negative offsets as well
    as offsets beyond EOF. This affects filesystems which don't implement
    SEEK_HOLE / SEEK_DATA internally, possibly because they don't support
    holes.

    Fixes xfstest generic/448.

    Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
    ---
    fs/read_write.c | 4 ++--
    1 file changed, 2 insertions(+), 2 deletions(-)

    --- a/fs/read_write.c
    +++ b/fs/read_write.c
    @@ -116,7 +116,7 @@ generic_file_llseek_size(struct file *fi
    * In the generic case the entire file is data, so as long as
    * offset isn't at the end of the file then the offset is data.
    */
    - if (offset >= eof)
    + if ((unsigned long long)offset >= eof)
    return -ENXIO;
    break;
    case SEEK_HOLE:
    @@ -124,7 +124,7 @@ generic_file_llseek_size(struct file *fi
    * There is a virtual hole at the end of the file, so as long as
    * offset isn't i_size or larger, return i_size.
    */
    - if (offset >= eof)
    + if ((unsigned long long)offset >= eof)
    return -ENXIO;
    offset = eof;
    break;
    \
     
     \ /
      Last update: 2017-12-28 18:47    [W:4.218 / U:0.080 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site