• NeilBrown's avatar
    NFS: swap-out must always use STABLE writes. · c265de25
    NeilBrown authored
    The commit handling code is not safe against memory-pressure deadlocks
    when writing to swap.  In particular, nfs_commitdata_alloc() blocks
    indefinitely waiting for memory, and this can consume all available
    workqueue threads.
    
    swap-out most likely uses STABLE writes anyway as COND_STABLE indicates
    that a stable write should be used if the write fits in a single
    request, and it normally does.  However if we ever swap with a small
    wsize, or gather unusually large numbers of pages for a single write,
    this might change.
    
    For safety, make it explicit in the code that direct writes used for swap
    must always use FLUSH_STABLE.
    Signed-off-by: default avatarNeilBrown <neilb@suse.de>
    Signed-off-by: default avatarTrond Myklebust <trond.myklebust@hammerspace.com>
    c265de25
direct.c 26.9 KB