• Trond Myklebust's avatar
    NFS: Fix I/O request leakages · be74fddc
    Trond Myklebust authored
    commit f57dcf4c upstream.
    
    When we fail to add the request to the I/O queue, we currently leave it
    to the caller to free the failed request. However since some of the
    requests that fail are actually created by nfs_pageio_add_request()
    itself, and are not passed back the caller, this leads to a leakage
    issue, which can again cause page locks to leak.
    
    This commit addresses the leakage by freeing the created requests on
    error, using desc->pg_completion_ops->error_cleanup()
    Signed-off-by: default avatarTrond Myklebust <trond.myklebust@hammerspace.com>
    Fixes: a7d42ddb ("nfs: add mirroring support to pgio layer")
    Cc: stable@vger.kernel.org # v4.0: c18b96a1: nfs: clean up rest of reqs
    Cc: stable@vger.kernel.org # v4.0: d600ad1f: NFS41: pop some layoutget
    Cc: stable@vger.kernel.org # v4.0+
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    be74fddc
pagelist.c 34 KB