• Chuck Lever's avatar
    NFSD: Use svcxdr_encode_opaque_pages() in nfsd4_encode_splice_read() · ba21e20b
    Chuck Lever authored
    Commit 15b23ef5 ("nfsd4: fix corruption of NFSv4 read data")
    encountered exactly the same issue: after a splice read, a
    filesystem-owned page is left in rq_pages[]; the symptoms are the
    same as described there.
    
    If the computed number of pages in nfsd4_encode_splice_read() is not
    exactly the same as the actual number of pages that were consumed by
    nfsd_splice_actor() (say, because of a bug) then hilarity ensues.
    
    Instead of recomputing the page offset based on the size of the
    payload, use rq_next_page, which is already properly updated by
    nfsd_splice_actor(), to cause svc_rqst_release_pages() to operate
    correctly in every instance.
    
    This is a defensive change since we believe that after commit
    27c934dd ("nfsd: don't replace page in rq_pages if it's a
    continuation of last page") has been applied, there are no known
    opportunities for nfsd_splice_actor() to screw up. So I'm not
    marking it for stable backport.
    Reported-by: default avatarAndy Zlotek <andy.zlotek@oracle.com>
    Suggested-by: default avatarCalum Mackay <calum.mackay@oracle.com>
    Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
    ba21e20b
nfs4xdr.c 141 KB