lkml.org 
[lkml]   [2019]   [Sep]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 4.19 49/79] NFSv2: Fix eof handling
    Date
    From: Trond Myklebust <trond.myklebust@hammerspace.com>

    [ Upstream commit 71affe9be45a5c60b9772e1b2701710712637274 ]

    If we received a reply from the server with a zero length read and
    no error, then that implies we are at eof.

    Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    ---
    fs/nfs/proc.c | 3 ++-
    1 file changed, 2 insertions(+), 1 deletion(-)

    diff --git a/fs/nfs/proc.c b/fs/nfs/proc.c
    index e0c257bd62b93..89fa9c706b380 100644
    --- a/fs/nfs/proc.c
    +++ b/fs/nfs/proc.c
    @@ -594,7 +594,8 @@ static int nfs_read_done(struct rpc_task *task, struct nfs_pgio_header *hdr)
    /* Emulate the eof flag, which isn't normally needed in NFSv2
    * as it is guaranteed to always return the file attributes
    */
    - if (hdr->args.offset + hdr->res.count >= hdr->res.fattr->size)
    + if ((hdr->res.count == 0 && hdr->args.count > 0) ||
    + hdr->args.offset + hdr->res.count >= hdr->res.fattr->size)
    hdr->res.eof = 1;
    }
    return 0;
    --
    2.20.1


    \
     
     \ /
      Last update: 2019-09-20 00:33    [W:4.377 / U:0.172 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site