Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'nfs-for-5.17-2' of git://git.linux-nfs.org/projects/anna/linux-nfs

Pull NFS client fixes from Anna Schumaker:
"Stable Fixes:

- Fix initialization of nfs_client cl_flags

Other Fixes:

- Fix performance issues with uncached readdir calls

- Fix potential pointer dereferences in rpcrdma_ep_create

- Fix nfs4_proc_get_locations() kernel-doc comment

- Fix locking during sunrpc sysfs reads

- Update my email address in the MAINTAINERS file to my new
kernel.org email"

* tag 'nfs-for-5.17-2' of git://git.linux-nfs.org/projects/anna/linux-nfs:
SUNRPC: lock against ->sock changing during sysfs read
MAINTAINERS: Update my email address
NFS: Fix nfs4_proc_get_locations() kernel-doc comment
xprtrdma: fix pointer derefs in error cases of rpcrdma_ep_create
NFS: Fix initialisation of nfs_client cl_flags field
NFS: Avoid duplicate uncached readdir calls on eof
NFS: Don't skip directory entries when doing uncached readdir
NFS: Don't overfill uncached readdir pages

+36 -11
+1 -1
MAINTAINERS
··· 13571 13571 13572 13572 NFS, SUNRPC, AND LOCKD CLIENTS 13573 13573 M: Trond Myklebust <trond.myklebust@hammerspace.com> 13574 - M: Anna Schumaker <anna.schumaker@netapp.com> 13574 + M: Anna Schumaker <anna@kernel.org> 13575 13575 L: linux-nfs@vger.kernel.org 13576 13576 S: Maintained 13577 13577 W: http://client.linux-nfs.org
+1 -1
fs/nfs/client.c
··· 177 177 INIT_LIST_HEAD(&clp->cl_superblocks); 178 178 clp->cl_rpcclient = ERR_PTR(-EINVAL); 179 179 180 + clp->cl_flags = cl_init->init_flags; 180 181 clp->cl_proto = cl_init->proto; 181 182 clp->cl_nconnect = cl_init->nconnect; 182 183 clp->cl_max_connect = cl_init->max_connect ? cl_init->max_connect : 1; ··· 424 423 list_add_tail(&new->cl_share_link, 425 424 &nn->nfs_client_list); 426 425 spin_unlock(&nn->nfs_client_lock); 427 - new->cl_flags = cl_init->init_flags; 428 426 return rpc_ops->init_client(new, cl_init); 429 427 } 430 428
+18 -6
fs/nfs/dir.c
··· 80 80 ctx->dir_cookie = 0; 81 81 ctx->dup_cookie = 0; 82 82 ctx->page_index = 0; 83 + ctx->eof = false; 83 84 spin_lock(&dir->i_lock); 84 85 if (list_empty(&nfsi->open_files) && 85 86 (nfsi->cache_validity & NFS_INO_DATA_INVAL_DEFER)) ··· 169 168 unsigned int cache_entry_index; 170 169 signed char duped; 171 170 bool plus; 171 + bool eob; 172 172 bool eof; 173 173 }; 174 174 ··· 869 867 870 868 status = nfs_readdir_page_filler(desc, entry, pages, pglen, 871 869 arrays, narrays); 872 - } while (!status && nfs_readdir_page_needs_filling(page)); 870 + } while (!status && nfs_readdir_page_needs_filling(page) && 871 + page_mapping(page)); 873 872 874 873 nfs_readdir_free_pages(pages, array_size); 875 874 out: ··· 991 988 ent = &array->array[i]; 992 989 if (!dir_emit(desc->ctx, ent->name, ent->name_len, 993 990 nfs_compat_user_ino64(ent->ino), ent->d_type)) { 994 - desc->eof = true; 991 + desc->eob = true; 995 992 break; 996 993 } 997 994 memcpy(desc->verf, verf, sizeof(desc->verf)); ··· 1007 1004 desc->duped = 1; 1008 1005 } 1009 1006 if (array->page_is_eof) 1010 - desc->eof = true; 1007 + desc->eof = !desc->eob; 1011 1008 1012 1009 kunmap(desc->page); 1013 1010 dfprintk(DIRCACHE, "NFS: nfs_do_filldir() filling ended @ cookie %llu\n", ··· 1044 1041 goto out; 1045 1042 1046 1043 desc->page_index = 0; 1044 + desc->cache_entry_index = 0; 1047 1045 desc->last_cookie = desc->dir_cookie; 1048 1046 desc->duped = 0; 1049 1047 1050 1048 status = nfs_readdir_xdr_to_array(desc, desc->verf, verf, arrays, sz); 1051 1049 1052 - for (i = 0; !desc->eof && i < sz && arrays[i]; i++) { 1050 + for (i = 0; !desc->eob && i < sz && arrays[i]; i++) { 1053 1051 desc->page = arrays[i]; 1054 1052 nfs_do_filldir(desc, verf); 1055 1053 } ··· 1109 1105 desc->duped = dir_ctx->duped; 1110 1106 page_index = dir_ctx->page_index; 1111 1107 desc->attr_gencount = dir_ctx->attr_gencount; 1108 + desc->eof = dir_ctx->eof; 1112 1109 memcpy(desc->verf, dir_ctx->verf, sizeof(desc->verf)); 1113 1110 spin_unlock(&file->f_lock); 1111 + 1112 + if (desc->eof) { 1113 + res = 0; 1114 + goto out_free; 1115 + } 1114 1116 1115 1117 if (test_and_clear_bit(NFS_INO_FORCE_READDIR, &nfsi->flags) && 1116 1118 list_is_singular(&nfsi->open_files)) ··· 1151 1141 1152 1142 nfs_do_filldir(desc, nfsi->cookieverf); 1153 1143 nfs_readdir_page_unlock_and_put_cached(desc); 1154 - } while (!desc->eof); 1144 + } while (!desc->eob && !desc->eof); 1155 1145 1156 1146 spin_lock(&file->f_lock); 1157 1147 dir_ctx->dir_cookie = desc->dir_cookie; ··· 1159 1149 dir_ctx->duped = desc->duped; 1160 1150 dir_ctx->attr_gencount = desc->attr_gencount; 1161 1151 dir_ctx->page_index = desc->page_index; 1152 + dir_ctx->eof = desc->eof; 1162 1153 memcpy(dir_ctx->verf, desc->verf, sizeof(dir_ctx->verf)); 1163 1154 spin_unlock(&file->f_lock); 1164 - 1155 + out_free: 1165 1156 kfree(desc); 1166 1157 1167 1158 out: ··· 1204 1193 if (offset == 0) 1205 1194 memset(dir_ctx->verf, 0, sizeof(dir_ctx->verf)); 1206 1195 dir_ctx->duped = 0; 1196 + dir_ctx->eof = false; 1207 1197 } 1208 1198 spin_unlock(&filp->f_lock); 1209 1199 return offset;
+2 -1
fs/nfs/nfs4proc.c
··· 8032 8032 8033 8033 /** 8034 8034 * nfs4_proc_get_locations - discover locations for a migrated FSID 8035 - * @inode: inode on FSID that is migrating 8035 + * @server: pointer to nfs_server to process 8036 + * @fhandle: pointer to the kernel NFS client file handle 8036 8037 * @locations: result of query 8037 8038 * @page: buffer 8038 8039 * @cred: credential to use for this operation
+1
include/linux/nfs_fs.h
··· 107 107 __u64 dup_cookie; 108 108 pgoff_t page_index; 109 109 signed char duped; 110 + bool eof; 110 111 }; 111 112 112 113 /*
+4 -1
net/sunrpc/sysfs.c
··· 115 115 } 116 116 117 117 sock = container_of(xprt, struct sock_xprt, xprt); 118 - if (kernel_getsockname(sock->sock, (struct sockaddr *)&saddr) < 0) 118 + mutex_lock(&sock->recv_mutex); 119 + if (sock->sock == NULL || 120 + kernel_getsockname(sock->sock, (struct sockaddr *)&saddr) < 0) 119 121 goto out; 120 122 121 123 ret = sprintf(buf, "%pISc\n", &saddr); 122 124 out: 125 + mutex_unlock(&sock->recv_mutex); 123 126 xprt_put(xprt); 124 127 return ret + 1; 125 128 }
+3
net/sunrpc/xprtrdma/verbs.c
··· 413 413 IB_POLL_WORKQUEUE); 414 414 if (IS_ERR(ep->re_attr.send_cq)) { 415 415 rc = PTR_ERR(ep->re_attr.send_cq); 416 + ep->re_attr.send_cq = NULL; 416 417 goto out_destroy; 417 418 } 418 419 ··· 422 421 IB_POLL_WORKQUEUE); 423 422 if (IS_ERR(ep->re_attr.recv_cq)) { 424 423 rc = PTR_ERR(ep->re_attr.recv_cq); 424 + ep->re_attr.recv_cq = NULL; 425 425 goto out_destroy; 426 426 } 427 427 ep->re_receive_count = 0; ··· 461 459 ep->re_pd = ib_alloc_pd(device, 0); 462 460 if (IS_ERR(ep->re_pd)) { 463 461 rc = PTR_ERR(ep->re_pd); 462 + ep->re_pd = NULL; 464 463 goto out_destroy; 465 464 } 466 465
+6 -1
net/sunrpc/xprtsock.c
··· 1641 1641 unsigned short get_srcport(struct rpc_xprt *xprt) 1642 1642 { 1643 1643 struct sock_xprt *sock = container_of(xprt, struct sock_xprt, xprt); 1644 - return xs_sock_getport(sock->sock); 1644 + unsigned short ret = 0; 1645 + mutex_lock(&sock->recv_mutex); 1646 + if (sock->sock) 1647 + ret = xs_sock_getport(sock->sock); 1648 + mutex_unlock(&sock->recv_mutex); 1649 + return ret; 1645 1650 } 1646 1651 EXPORT_SYMBOL(get_srcport); 1647 1652