• Frank Sorenson's avatar
    NFS: advance nfs_entry cookie only after decoding completes successfully · 98de9ce6
    Frank Sorenson authored
    In nfs[34]_decode_dirent, the cookie is advanced as soon as it is
    read, but decoding may still fail later in the function, returning
    an error.  Because the cookie has been advanced, the failing entry
    is not re-requested from the server, resulting in a missing directory
    entry.
    
    In addition, nfs v3 and v4 read the cookie at different locations
    in the xdr_stream, so the behavior of the two can be inconsistent.
    
    Fix these by reading the cookie into a temporary variable, and
    only advancing the cookie once the entire entry has been decoded
    from the xdr_stream successfully.
    Signed-off-by: default avatarFrank Sorenson <sorenson@redhat.com>
    Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
    98de9ce6
nfs4xdr.c 202 KB