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

Pull NFS client fixes from Anna Schumaker:
"Stable Fix:
- Fix a pNFS hang in nfs4_evict_inode()

Fixes:
- Force update of suid/sgid bits after an NFS v4.2 ALLOCATE op
- Fix a potential oops in nfs_inode_remove_request()
- Check the validity of the layout pointer in ff_layout_mirror_prepare_stats()
- Fix incorrectly marking the pNFS MDS with USE_PNFS_DS in some cases"

* tag 'nfs-for-6.6-4' of git://git.linux-nfs.org/projects/anna/linux-nfs:
NFSv4.1: fixup use EXCHGID4_FLAG_USE_PNFS_DS for DS server
pNFS/flexfiles: Check the layout validity in ff_layout_mirror_prepare_stats
pNFS: Fix a hang in nfs4_evict_inode()
NFS: Fix potential oops in nfs_inode_remove_request()
nfs42: client needs to strip file mode's suid/sgid bit after ALLOCATE op

+38 -21
+10 -7
fs/nfs/flexfilelayout/flexfilelayout.c
··· 2520 2520 return i; 2521 2521 } 2522 2522 2523 - static int 2524 - ff_layout_prepare_layoutstats(struct nfs42_layoutstat_args *args) 2523 + static int ff_layout_prepare_layoutstats(struct nfs42_layoutstat_args *args) 2525 2524 { 2525 + struct pnfs_layout_hdr *lo; 2526 2526 struct nfs4_flexfile_layout *ff_layout; 2527 2527 const int dev_count = PNFS_LAYOUTSTATS_MAXDEV; 2528 2528 ··· 2533 2533 return -ENOMEM; 2534 2534 2535 2535 spin_lock(&args->inode->i_lock); 2536 - ff_layout = FF_LAYOUT_FROM_HDR(NFS_I(args->inode)->layout); 2537 - args->num_dev = ff_layout_mirror_prepare_stats(&ff_layout->generic_hdr, 2538 - &args->devinfo[0], 2539 - dev_count, 2540 - NFS4_FF_OP_LAYOUTSTATS); 2536 + lo = NFS_I(args->inode)->layout; 2537 + if (lo && pnfs_layout_is_valid(lo)) { 2538 + ff_layout = FF_LAYOUT_FROM_HDR(lo); 2539 + args->num_dev = ff_layout_mirror_prepare_stats( 2540 + &ff_layout->generic_hdr, &args->devinfo[0], dev_count, 2541 + NFS4_FF_OP_LAYOUTSTATS); 2542 + } else 2543 + args->num_dev = 0; 2541 2544 spin_unlock(&args->inode->i_lock); 2542 2545 if (!args->num_dev) { 2543 2546 kfree(args->devinfo);
+2 -1
fs/nfs/nfs42proc.c
··· 81 81 if (status == 0) { 82 82 if (nfs_should_remove_suid(inode)) { 83 83 spin_lock(&inode->i_lock); 84 - nfs_set_cache_invalid(inode, NFS_INO_INVALID_MODE); 84 + nfs_set_cache_invalid(inode, 85 + NFS_INO_REVAL_FORCED | NFS_INO_INVALID_MODE); 85 86 spin_unlock(&inode->i_lock); 86 87 } 87 88 status = nfs_post_op_update_inode_force_wcc(inode,
-2
fs/nfs/nfs4proc.c
··· 8870 8870 /* Save the EXCHANGE_ID verifier session trunk tests */ 8871 8871 memcpy(clp->cl_confirm.data, argp->verifier.data, 8872 8872 sizeof(clp->cl_confirm.data)); 8873 - if (resp->flags & EXCHGID4_FLAG_USE_PNFS_DS) 8874 - set_bit(NFS_CS_DS, &clp->cl_flags); 8875 8873 out: 8876 8874 trace_nfs4_exchange_id(clp, status); 8877 8875 rpc_put_task(task);
+23 -10
fs/nfs/pnfs.c
··· 2634 2634 return mode == 0; 2635 2635 } 2636 2636 2637 - static int 2638 - pnfs_layout_return_unused_byserver(struct nfs_server *server, void *data) 2637 + static int pnfs_layout_return_unused_byserver(struct nfs_server *server, 2638 + void *data) 2639 2639 { 2640 2640 const struct pnfs_layout_range *range = data; 2641 + const struct cred *cred; 2641 2642 struct pnfs_layout_hdr *lo; 2642 2643 struct inode *inode; 2644 + nfs4_stateid stateid; 2645 + enum pnfs_iomode iomode; 2646 + 2643 2647 restart: 2644 2648 rcu_read_lock(); 2645 2649 list_for_each_entry_rcu(lo, &server->layouts, plh_layouts) { 2646 - if (!pnfs_layout_can_be_returned(lo) || 2650 + inode = lo->plh_inode; 2651 + if (!inode || !pnfs_layout_can_be_returned(lo) || 2647 2652 test_bit(NFS_LAYOUT_RETURN_REQUESTED, &lo->plh_flags)) 2648 2653 continue; 2649 - inode = lo->plh_inode; 2650 2654 spin_lock(&inode->i_lock); 2651 - if (!pnfs_should_return_unused_layout(lo, range)) { 2655 + if (!lo->plh_inode || 2656 + !pnfs_should_return_unused_layout(lo, range)) { 2652 2657 spin_unlock(&inode->i_lock); 2653 2658 continue; 2654 2659 } 2660 + pnfs_get_layout_hdr(lo); 2661 + pnfs_set_plh_return_info(lo, range->iomode, 0); 2662 + if (pnfs_mark_matching_lsegs_return(lo, &lo->plh_return_segs, 2663 + range, 0) != 0 || 2664 + !pnfs_prepare_layoutreturn(lo, &stateid, &cred, &iomode)) { 2665 + spin_unlock(&inode->i_lock); 2666 + rcu_read_unlock(); 2667 + pnfs_put_layout_hdr(lo); 2668 + cond_resched(); 2669 + goto restart; 2670 + } 2655 2671 spin_unlock(&inode->i_lock); 2656 - inode = pnfs_grab_inode_layout_hdr(lo); 2657 - if (!inode) 2658 - continue; 2659 2672 rcu_read_unlock(); 2660 - pnfs_mark_layout_for_return(inode, range); 2661 - iput(inode); 2673 + pnfs_send_layoutreturn(lo, &stateid, &cred, iomode, false); 2674 + pnfs_put_layout_hdr(lo); 2662 2675 cond_resched(); 2663 2676 goto restart; 2664 2677 }
+3 -1
fs/nfs/write.c
··· 788 788 */ 789 789 static void nfs_inode_remove_request(struct nfs_page *req) 790 790 { 791 + struct nfs_inode *nfsi = NFS_I(nfs_page_to_inode(req)); 792 + 791 793 if (nfs_page_group_sync_on_bit(req, PG_REMOVE)) { 792 794 struct folio *folio = nfs_page_to_folio(req->wb_head); 793 795 struct address_space *mapping = folio_file_mapping(folio); ··· 804 802 } 805 803 806 804 if (test_and_clear_bit(PG_INODE_REF, &req->wb_flags)) { 807 - atomic_long_dec(&NFS_I(nfs_page_to_inode(req))->nrequests); 805 + atomic_long_dec(&nfsi->nrequests); 808 806 nfs_release_request(req); 809 807 } 810 808 }