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-4.12-2' of git://git.linux-nfs.org/projects/trondmy/linux-nfs

Pull NFS client bugfixes from Trond Myklebust:
"Bugfixes include:

- Fix a typo in commit e092693443b ("NFS append COMMIT after
synchronous COPY") that breaks copy offload

- Fix the connect error propagation in xs_tcp_setup_socket()

- Fix a lock leak in nfs40_walk_client_list

- Verify that pNFS requests lie within the offset range of the layout
segment"

* tag 'nfs-for-4.12-2' of git://git.linux-nfs.org/projects/trondmy/linux-nfs:
nfs: Mark unnecessarily extern functions as static
SUNRPC: ensure correct error is reported by xs_tcp_setup_socket()
NFSv4.0: Fix a lock leak in nfs40_walk_client_list
pnfs: Fix the check for requests in range of layout segment
xprtrdma: Delete an error message for a failed memory allocation in xprt_rdma_bc_setup()
pNFS/flexfiles: missing error code in ff_layout_alloc_lseg()
NFS fix COMMIT after COPY

+40 -19
+1
fs/nfs/flexfilelayout/flexfilelayout.c
··· 454 454 goto out_err_free; 455 455 456 456 /* fh */ 457 + rc = -EIO; 457 458 p = xdr_inline_decode(&stream, 4); 458 459 if (!p) 459 460 goto out_err_free;
-2
fs/nfs/internal.h
··· 398 398 bool nfs_auth_info_match(const struct nfs_auth_info *, rpc_authflavor_t); 399 399 struct dentry *nfs_try_mount(int, const char *, struct nfs_mount_info *, 400 400 struct nfs_subversion *); 401 - void nfs_initialise_sb(struct super_block *); 402 401 int nfs_set_sb_security(struct super_block *, struct dentry *, struct nfs_mount_info *); 403 402 int nfs_clone_sb_security(struct super_block *, struct dentry *, struct nfs_mount_info *); 404 403 struct dentry *nfs_fs_mount_common(struct nfs_server *, int, const char *, ··· 457 458 extern void nfs_pageio_reset_read_mds(struct nfs_pageio_descriptor *pgio); 458 459 459 460 /* super.c */ 460 - void nfs_clone_super(struct super_block *, struct nfs_mount_info *); 461 461 void nfs_umount_begin(struct super_block *); 462 462 int nfs_statfs(struct dentry *, struct kstatfs *); 463 463 int nfs_show_options(struct seq_file *, struct dentry *);
+1 -1
fs/nfs/nfs42proc.c
··· 177 177 if (status) 178 178 goto out; 179 179 180 - if (!nfs_write_verifier_cmp(&res->write_res.verifier.verifier, 180 + if (nfs_write_verifier_cmp(&res->write_res.verifier.verifier, 181 181 &res->commit_res.verf->verifier)) { 182 182 status = -EAGAIN; 183 183 goto out;
-1
fs/nfs/nfs4client.c
··· 582 582 */ 583 583 nfs4_schedule_path_down_recovery(pos); 584 584 default: 585 - spin_lock(&nn->nfs_client_lock); 586 585 goto out; 587 586 } 588 587
+17 -8
fs/nfs/pnfs.c
··· 2094 2094 } 2095 2095 EXPORT_SYMBOL_GPL(pnfs_generic_pg_check_layout); 2096 2096 2097 + /* 2098 + * Check for any intersection between the request and the pgio->pg_lseg, 2099 + * and if none, put this pgio->pg_lseg away. 2100 + */ 2101 + static void 2102 + pnfs_generic_pg_check_range(struct nfs_pageio_descriptor *pgio, struct nfs_page *req) 2103 + { 2104 + if (pgio->pg_lseg && !pnfs_lseg_request_intersecting(pgio->pg_lseg, req)) { 2105 + pnfs_put_lseg(pgio->pg_lseg); 2106 + pgio->pg_lseg = NULL; 2107 + } 2108 + } 2109 + 2097 2110 void 2098 2111 pnfs_generic_pg_init_read(struct nfs_pageio_descriptor *pgio, struct nfs_page *req) 2099 2112 { 2100 2113 u64 rd_size = req->wb_bytes; 2101 2114 2102 2115 pnfs_generic_pg_check_layout(pgio); 2116 + pnfs_generic_pg_check_range(pgio, req); 2103 2117 if (pgio->pg_lseg == NULL) { 2104 2118 if (pgio->pg_dreq == NULL) 2105 2119 rd_size = i_size_read(pgio->pg_inode) - req_offset(req); ··· 2145 2131 struct nfs_page *req, u64 wb_size) 2146 2132 { 2147 2133 pnfs_generic_pg_check_layout(pgio); 2134 + pnfs_generic_pg_check_range(pgio, req); 2148 2135 if (pgio->pg_lseg == NULL) { 2149 2136 pgio->pg_lseg = pnfs_update_layout(pgio->pg_inode, 2150 2137 req->wb_context, ··· 2206 2191 seg_end = pnfs_end_offset(pgio->pg_lseg->pls_range.offset, 2207 2192 pgio->pg_lseg->pls_range.length); 2208 2193 req_start = req_offset(req); 2209 - WARN_ON_ONCE(req_start >= seg_end); 2194 + 2210 2195 /* start of request is past the last byte of this segment */ 2211 - if (req_start >= seg_end) { 2212 - /* reference the new lseg */ 2213 - if (pgio->pg_ops->pg_cleanup) 2214 - pgio->pg_ops->pg_cleanup(pgio); 2215 - if (pgio->pg_ops->pg_init) 2216 - pgio->pg_ops->pg_init(pgio, req); 2196 + if (req_start >= seg_end) 2217 2197 return 0; 2218 - } 2219 2198 2220 2199 /* adjust 'size' iff there are fewer bytes left in the 2221 2200 * segment than what nfs_generic_pg_test returned */
+10
fs/nfs/pnfs.h
··· 593 593 return pnfs_is_range_intersecting(l1->offset, end1, l2->offset, end2); 594 594 } 595 595 596 + static inline bool 597 + pnfs_lseg_request_intersecting(struct pnfs_layout_segment *lseg, struct nfs_page *req) 598 + { 599 + u64 seg_last = pnfs_end_offset(lseg->pls_range.offset, lseg->pls_range.length); 600 + u64 req_last = req_offset(req) + req->wb_bytes; 601 + 602 + return pnfs_is_range_intersecting(lseg->pls_range.offset, seg_last, 603 + req_offset(req), req_last); 604 + } 605 + 596 606 extern unsigned int layoutstats_timer; 597 607 598 608 #ifdef NFS_DEBUG
+3 -2
fs/nfs/super.c
··· 2301 2301 /* 2302 2302 * Initialise the common bits of the superblock 2303 2303 */ 2304 - inline void nfs_initialise_sb(struct super_block *sb) 2304 + static void nfs_initialise_sb(struct super_block *sb) 2305 2305 { 2306 2306 struct nfs_server *server = NFS_SB(sb); 2307 2307 ··· 2348 2348 /* 2349 2349 * Finish setting up a cloned NFS2/3/4 superblock 2350 2350 */ 2351 - void nfs_clone_super(struct super_block *sb, struct nfs_mount_info *mount_info) 2351 + static void nfs_clone_super(struct super_block *sb, 2352 + struct nfs_mount_info *mount_info) 2352 2353 { 2353 2354 const struct super_block *old_sb = mount_info->cloned->sb; 2354 2355 struct nfs_server *server = NFS_SB(sb);
+2 -4
net/sunrpc/xprtrdma/backchannel.c
··· 119 119 120 120 for (i = 0; i < (reqs << 1); i++) { 121 121 rqst = kzalloc(sizeof(*rqst), GFP_KERNEL); 122 - if (!rqst) { 123 - pr_err("RPC: %s: Failed to create bc rpc_rqst\n", 124 - __func__); 122 + if (!rqst) 125 123 goto out_free; 126 - } 124 + 127 125 dprintk("RPC: %s: new rqst %p\n", __func__, rqst); 128 126 129 127 rqst->rq_xprt = &r_xprt->rx_xprt;
+6 -1
net/sunrpc/xprtsock.c
··· 2432 2432 case -ENETUNREACH: 2433 2433 case -EADDRINUSE: 2434 2434 case -ENOBUFS: 2435 - /* retry with existing socket, after a delay */ 2435 + /* 2436 + * xs_tcp_force_close() wakes tasks with -EIO. 2437 + * We need to wake them first to ensure the 2438 + * correct error code. 2439 + */ 2440 + xprt_wake_pending_tasks(xprt, status); 2436 2441 xs_tcp_force_close(xprt); 2437 2442 goto out; 2438 2443 }