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

Pull NFS client fixes from Anna Schumaker:

- Add FMODE_CAN_ODIRECT support to NFSv4 so opens don't fail

- Fix trunking detection & cl_max_connect setting

- Avoid pnfs_update_layout() livelocks

- Don't keep retrying pNFS if the server replies with NFS4ERR_UNAVAILABLE

* tag 'nfs-for-5.19-2' of git://git.linux-nfs.org/projects/anna/linux-nfs:
NFSv4: Add FMODE_CAN_ODIRECT after successful open of a NFS4.x file
sunrpc: set cl_max_connect when cloning an rpc_clnt
pNFS: Avoid a live lock condition in pnfs_update_layout()
pNFS: Don't keep retrying if the server replied NFS4ERR_LAYOUTUNAVAILABLE

+20 -6
+1
fs/nfs/callback_proc.c
··· 288 288 rv = NFS4_OK; 289 289 break; 290 290 case -ENOENT: 291 + set_bit(NFS_LAYOUT_DRAIN, &lo->plh_flags); 291 292 /* Embrace your forgetfulness! */ 292 293 rv = NFS4ERR_NOMATCHING_LAYOUT; 293 294
+1
fs/nfs/dir.c
··· 2124 2124 } 2125 2125 goto out; 2126 2126 } 2127 + file->f_mode |= FMODE_CAN_ODIRECT; 2127 2128 2128 2129 err = nfs_finish_open(ctx, ctx->dentry, file, open_flags); 2129 2130 trace_nfs_atomic_open_exit(dir, ctx, open_flags, err);
+1
fs/nfs/nfs4file.c
··· 93 93 nfs_file_set_open_context(filp, ctx); 94 94 nfs_fscache_open_file(inode, filp); 95 95 err = 0; 96 + filp->f_mode |= FMODE_CAN_ODIRECT; 96 97 97 98 out_put_ctx: 98 99 put_nfs_open_context(ctx);
+15 -6
fs/nfs/pnfs.c
··· 469 469 pnfs_clear_lseg_state(lseg, lseg_list); 470 470 pnfs_clear_layoutreturn_info(lo); 471 471 pnfs_free_returned_lsegs(lo, lseg_list, &range, 0); 472 + set_bit(NFS_LAYOUT_DRAIN, &lo->plh_flags); 472 473 if (test_bit(NFS_LAYOUT_RETURN, &lo->plh_flags) && 473 474 !test_and_set_bit(NFS_LAYOUT_RETURN_LOCK, &lo->plh_flags)) 474 475 pnfs_clear_layoutreturn_waitbit(lo); ··· 1918 1917 1919 1918 static void nfs_layoutget_end(struct pnfs_layout_hdr *lo) 1920 1919 { 1921 - if (atomic_dec_and_test(&lo->plh_outstanding)) 1922 - wake_up_var(&lo->plh_outstanding); 1920 + if (atomic_dec_and_test(&lo->plh_outstanding) && 1921 + test_and_clear_bit(NFS_LAYOUT_DRAIN, &lo->plh_flags)) 1922 + wake_up_bit(&lo->plh_flags, NFS_LAYOUT_DRAIN); 1923 1923 } 1924 1924 1925 1925 static bool pnfs_is_first_layoutget(struct pnfs_layout_hdr *lo) ··· 2027 2025 * If the layout segment list is empty, but there are outstanding 2028 2026 * layoutget calls, then they might be subject to a layoutrecall. 2029 2027 */ 2030 - if ((list_empty(&lo->plh_segs) || !pnfs_layout_is_valid(lo)) && 2028 + if (test_bit(NFS_LAYOUT_DRAIN, &lo->plh_flags) && 2031 2029 atomic_read(&lo->plh_outstanding) != 0) { 2032 2030 spin_unlock(&ino->i_lock); 2033 - lseg = ERR_PTR(wait_var_event_killable(&lo->plh_outstanding, 2034 - !atomic_read(&lo->plh_outstanding))); 2031 + lseg = ERR_PTR(wait_on_bit(&lo->plh_flags, NFS_LAYOUT_DRAIN, 2032 + TASK_KILLABLE)); 2035 2033 if (IS_ERR(lseg)) 2036 2034 goto out_put_layout_hdr; 2037 2035 pnfs_put_layout_hdr(lo); ··· 2154 2152 case -ERECALLCONFLICT: 2155 2153 case -EAGAIN: 2156 2154 break; 2155 + case -ENODATA: 2156 + /* The server returned NFS4ERR_LAYOUTUNAVAILABLE */ 2157 + pnfs_layout_set_fail_bit( 2158 + lo, pnfs_iomode_to_fail_bit(iomode)); 2159 + lseg = NULL; 2160 + goto out_put_layout_hdr; 2157 2161 default: 2158 2162 if (!nfs_error_is_fatal(PTR_ERR(lseg))) { 2159 2163 pnfs_layout_clear_fail_bit(lo, pnfs_iomode_to_fail_bit(iomode)); ··· 2415 2407 goto out_forget; 2416 2408 } 2417 2409 2418 - if (!pnfs_layout_is_valid(lo) && !pnfs_is_first_layoutget(lo)) 2410 + if (test_bit(NFS_LAYOUT_DRAIN, &lo->plh_flags) && 2411 + !pnfs_is_first_layoutget(lo)) 2419 2412 goto out_forget; 2420 2413 2421 2414 if (nfs4_stateid_match_other(&lo->plh_stateid, &res->stateid)) {
+1
fs/nfs/pnfs.h
··· 105 105 NFS_LAYOUT_FIRST_LAYOUTGET, /* Serialize first layoutget */ 106 106 NFS_LAYOUT_INODE_FREEING, /* The inode is being freed */ 107 107 NFS_LAYOUT_HASHED, /* The layout visible */ 108 + NFS_LAYOUT_DRAIN, 108 109 }; 109 110 110 111 enum layoutdriver_policy_flags {
+1
net/sunrpc/clnt.c
··· 651 651 new->cl_discrtry = clnt->cl_discrtry; 652 652 new->cl_chatty = clnt->cl_chatty; 653 653 new->cl_principal = clnt->cl_principal; 654 + new->cl_max_connect = clnt->cl_max_connect; 654 655 return new; 655 656 656 657 out_err: