• Andy Adamson's avatar
    NFS avoid expired credential keys for buffered writes · dc24826b
    Andy Adamson authored
    We must avoid buffering a WRITE that is using a credential key (e.g. a GSS
    context key) that is about to expire or has expired.  We currently will
    paint ourselves into a corner by returning success to the applciation
    for such a buffered WRITE, only to discover that we do not have permission when
    we attempt to flush the WRITE (and potentially associated COMMIT) to disk.
    
    Use the RPC layer credential key timeout and expire routines which use a
    a watermark, gss_key_expire_timeo. We test the key in nfs_file_write.
    
    If a WRITE is using a credential with a key that will expire within
    watermark seconds, flush the inode in nfs_write_end and send only
    NFS_FILE_SYNC WRITEs by adding nfs_ctx_key_to_expire to nfs_need_sync_write.
    Note that this results in single page NFS_FILE_SYNC WRITEs.
    Signed-off-by: default avatarAndy Adamson <andros@netapp.com>
    [Trond: removed a pr_warn_ratelimited() for now]
    Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
    dc24826b
file.c 26.1 KB