]> Git Repo - J-linux.git/commitdiff
Merge tag 'nfsd-6.2-3' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux
authorLinus Torvalds <[email protected]>
Tue, 10 Jan 2023 21:03:06 +0000 (15:03 -0600)
committerLinus Torvalds <[email protected]>
Tue, 10 Jan 2023 21:03:06 +0000 (15:03 -0600)
Pull nfsd fixes from Chuck Lever:

 - Fix a race when creating NFSv4 files

 - Revert the use of relaxed bitops

* tag 'nfsd-6.2-3' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux:
  NFSD: Use set_bit(RQ_DROPME)
  Revert "SUNRPC: Use RMW bitops in single-threaded hot paths"
  nfsd: fix handling of cached open files in nfsd4_open codepath

1  2 
fs/nfsd/nfs4state.c
net/sunrpc/svc.c
net/sunrpc/svcsock.c

diff --combined fs/nfsd/nfs4state.c
index 7b2ee535ade83235e0acaf5b4c6a9d1e75ecdd56,313f666d53578f17485ce6f50b0dc398b9a9cf17..4809ae0f013850928898ee32a5cac845db8d7156
@@@ -4824,7 -4824,7 +4824,7 @@@ nfs4_share_conflict(struct svc_fh *curr
  
  static bool nfsd4_deleg_present(const struct inode *inode)
  {
 -      struct file_lock_context *ctx = smp_load_acquire(&inode->i_flctx);
 +      struct file_lock_context *ctx = locks_inode_context(inode);
  
        return ctx && !list_empty_careful(&ctx->flc_lease);
  }
@@@ -5262,18 -5262,10 +5262,10 @@@ static __be32 nfs4_get_vfs_file(struct 
        if (!fp->fi_fds[oflag]) {
                spin_unlock(&fp->fi_lock);
  
-               if (!open->op_filp) {
-                       status = nfsd_file_acquire(rqstp, cur_fh, access, &nf);
-                       if (status != nfs_ok)
-                               goto out_put_access;
-               } else {
-                       status = nfsd_file_create(rqstp, cur_fh, access, &nf);
-                       if (status != nfs_ok)
-                               goto out_put_access;
-                       nf->nf_file = open->op_filp;
-                       open->op_filp = NULL;
-                       trace_nfsd_file_create(rqstp, access, nf);
-               }
+               status = nfsd_file_acquire_opened(rqstp, cur_fh, access,
+                                                 open->op_filp, &nf);
+               if (status != nfs_ok)
+                       goto out_put_access;
  
                spin_lock(&fp->fi_lock);
                if (!fp->fi_fds[oflag]) {
@@@ -5965,7 -5957,7 +5957,7 @@@ nfs4_lockowner_has_blockers(struct nfs4
  
        list_for_each_entry(stp, &lo->lo_owner.so_stateids, st_perstateowner) {
                nf = stp->st_stid.sc_file;
 -              ctx = nf->fi_inode->i_flctx;
 +              ctx = locks_inode_context(nf->fi_inode);
                if (!ctx)
                        continue;
                if (locks_owner_has_blockers(ctx, lo))
@@@ -7829,7 -7821,7 +7821,7 @@@ check_for_locks(struct nfs4_file *fp, s
        }
  
        inode = locks_inode(nf->nf_file);
 -      flctx = inode->i_flctx;
 +      flctx = locks_inode_context(inode);
  
        if (flctx && !list_empty_careful(&flctx->flc_posix)) {
                spin_lock(&flctx->flc_lock);
diff --combined net/sunrpc/svc.c
index 85f0c3cfc87745f26aa3f8d869c71f136be22997,b1da586c44765bddf99157e37efc83cec6501b48..f06622814a958a5248d8407dd60024360c9019c9
@@@ -567,7 -567,7 +567,7 @@@ svc_destroy(struct kref *ref
        struct svc_serv *serv = container_of(ref, struct svc_serv, sv_refcnt);
  
        dprintk("svc: svc_destroy(%s)\n", serv->sv_program->pg_name);
 -      del_timer_sync(&serv->sv_temptimer);
 +      timer_shutdown_sync(&serv->sv_temptimer);
  
        /*
         * The last user is gone and thus all sockets have to be destroyed to
@@@ -1243,10 -1243,10 +1243,10 @@@ svc_process_common(struct svc_rqst *rqs
                goto err_short_len;
  
        /* Will be turned off by GSS integrity and privacy services */
-       __set_bit(RQ_SPLICE_OK, &rqstp->rq_flags);
+       set_bit(RQ_SPLICE_OK, &rqstp->rq_flags);
        /* Will be turned off only when NFSv4 Sessions are used */
-       __set_bit(RQ_USEDEFERRAL, &rqstp->rq_flags);
-       __clear_bit(RQ_DROPME, &rqstp->rq_flags);
+       set_bit(RQ_USEDEFERRAL, &rqstp->rq_flags);
+       clear_bit(RQ_DROPME, &rqstp->rq_flags);
  
        svc_putu32(resv, rqstp->rq_xid);
  
diff --combined net/sunrpc/svcsock.c
index 015714398007aef28bcf5957a0994dc7cc5f4f5c,e833103f46291078b19eac0d49cda7a2bd5c03b8..815baf308236a9d20ed7103603cfbc2af1fa1bd9
@@@ -260,7 -260,7 +260,7 @@@ static ssize_t svc_tcp_read_msg(struct 
        rqstp->rq_respages = &rqstp->rq_pages[i];
        rqstp->rq_next_page = rqstp->rq_respages + 1;
  
 -      iov_iter_bvec(&msg.msg_iter, READ, bvec, i, buflen);
 +      iov_iter_bvec(&msg.msg_iter, ITER_DEST, bvec, i, buflen);
        if (seek) {
                iov_iter_advance(&msg.msg_iter, seek);
                buflen -= seek;
@@@ -298,9 -298,9 +298,9 @@@ static void svc_sock_setbufsize(struct 
  static void svc_sock_secure_port(struct svc_rqst *rqstp)
  {
        if (svc_port_is_privileged(svc_addr(rqstp)))
-               __set_bit(RQ_SECURE, &rqstp->rq_flags);
+               set_bit(RQ_SECURE, &rqstp->rq_flags);
        else
-               __clear_bit(RQ_SECURE, &rqstp->rq_flags);
+               clear_bit(RQ_SECURE, &rqstp->rq_flags);
  }
  
  /*
@@@ -874,7 -874,7 +874,7 @@@ static ssize_t svc_tcp_read_marker(stru
                want = sizeof(rpc_fraghdr) - svsk->sk_tcplen;
                iov.iov_base = ((char *)&svsk->sk_marker) + svsk->sk_tcplen;
                iov.iov_len  = want;
 -              iov_iter_kvec(&msg.msg_iter, READ, &iov, 1, want);
 +              iov_iter_kvec(&msg.msg_iter, ITER_DEST, &iov, 1, want);
                len = sock_recvmsg(svsk->sk_sock, &msg, MSG_DONTWAIT);
                if (len < 0)
                        return len;
@@@ -1008,9 -1008,9 +1008,9 @@@ static int svc_tcp_recvfrom(struct svc_
        rqstp->rq_xprt_ctxt   = NULL;
        rqstp->rq_prot        = IPPROTO_TCP;
        if (test_bit(XPT_LOCAL, &svsk->sk_xprt.xpt_flags))
-               __set_bit(RQ_LOCAL, &rqstp->rq_flags);
+               set_bit(RQ_LOCAL, &rqstp->rq_flags);
        else
-               __clear_bit(RQ_LOCAL, &rqstp->rq_flags);
+               clear_bit(RQ_LOCAL, &rqstp->rq_flags);
  
        p = (__be32 *)rqstp->rq_arg.head[0].iov_base;
        calldir = p[1];
This page took 0.110636 seconds and 4 git commands to generate.