lkml.org 
[lkml]   [2021]   [Sep]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH AUTOSEL 5.10 159/176] nfsd: fix crash on LOCKT on reexported NFSv3
    Date
    From: "J. Bruce Fields" <bfields@redhat.com>

    [ Upstream commit 0bcc7ca40bd823193224e9f38bafbd8325aaf566 ]

    Unlike other filesystems, NFSv3 tries to use fl_file in the GETLK case.

    Signed-off-by: J. Bruce Fields <bfields@redhat.com>
    Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    ---
    fs/nfsd/nfs4state.c | 5 +++--
    1 file changed, 3 insertions(+), 2 deletions(-)

    diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
    index 80e394a2e3fd..adacf2a66522 100644
    --- a/fs/nfsd/nfs4state.c
    +++ b/fs/nfsd/nfs4state.c
    @@ -6855,8 +6855,7 @@ nfsd4_lock(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
    /*
    * The NFSv4 spec allows a client to do a LOCKT without holding an OPEN,
    * so we do a temporary open here just to get an open file to pass to
    - * vfs_test_lock. (Arguably perhaps test_lock should be done with an
    - * inode operation.)
    + * vfs_test_lock.
    */
    static __be32 nfsd_test_lock(struct svc_rqst *rqstp, struct svc_fh *fhp, struct file_lock *lock)
    {
    @@ -6871,7 +6870,9 @@ static __be32 nfsd_test_lock(struct svc_rqst *rqstp, struct svc_fh *fhp, struct
    NFSD_MAY_READ));
    if (err)
    goto out;
    + lock->fl_file = nf->nf_file;
    err = nfserrno(vfs_test_lock(nf->nf_file, lock));
    + lock->fl_file = NULL;
    out:
    fh_unlock(fhp);
    nfsd_file_put(nf);
    --
    2.30.2
    \
     
     \ /
      Last update: 2021-09-09 14:50    [W:4.040 / U:0.488 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site