• T
    NFS: Fix I/O request leakages · af3f56a9
    Trond Myklebust 提交于
    commit f57dcf4c72113c745d83f1c65f7291299f65c14f 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: NTrond 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: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
    af3f56a9
pagelist.c 34.0 KB