Skip to content
  • Chuck Lever's avatar
    NFSD: Fill in WCC data for REMOVE, RMDIR, MKNOD, and MKDIR · 43a9aa64
    Chuck Lever authored
    
    
    Some well-known NFSv3 clients drop their directory entry caches when
    they receive replies with no WCC data.  Without this data, they
    employ extra READ, LOOKUP, and GETATTR requests to ensure their
    directory entry caches are up to date, causing performance to suffer
    needlessly.
    
    In order to return WCC data, our server has to have both the pre-op
    and the post-op attribute data on hand when a reply is XDR encoded.
    The pre-op data is filled in when the incoming fh is locked, and the
    post-op data is filled in when the fh is unlocked.
    
    Unfortunately, for REMOVE, RMDIR, MKNOD, and MKDIR, the directory fh
    is not unlocked until well after the reply has been XDR encoded.  This
    means that encode_wcc_data() does not have wcc_data for the parent
    directory, so none is returned to the client after these operations
    complete.
    
    By unlocking the parent directory fh immediately after the internal
    operations for each NFS procedure is complete, the post-op data is
    filled in before XDR encoding starts, so it can be returned to the
    client properly.
    
    Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
    Signed-off-by: default avatarJ. Bruce Fields <bfields@citi.umich.edu>
    43a9aa64