From: Linus Torvalds Date: Fri, 15 May 2026 20:11:41 +0000 (-0700) Subject: Merge tag 'nfsd-7.1-1' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux X-Git-Tag: v7.1-rc4~20 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=56ec2b646de6349c8c8c05c8df17b4d8998c467a;p=thirdparty%2Fkernel%2Flinux.git Merge tag 'nfsd-7.1-1' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux Pull nfsd fixes from Chuck Lever: "Fixes for this release: - Correctness fix for the new sunrpc cache netlink protocol Marked for stable: - Correctness fixes for delegated attributes - Prevent an infinite loop when revoking layouts" * tag 'nfsd-7.1-1' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux: NFSD: Fix infinite loop in layout state revocation sunrpc: start cache request seqno at 1 to fix netlink GET_REQS nfsd: update mtime/ctime on COPY in presence of delegated attributes nfsd: update mtime/ctime on CLONE in presense of delegated attributes nfsd: fix file change detection in CB_GETATTR nfsd: fix GET_DIR_DELEGATION when VFS leases are disabled --- 56ec2b646de6349c8c8c05c8df17b4d8998c467a diff --cc fs/nfsd/nfs4state.c index c2d13b26a6876,c92bc0c110650..6837b63d98645 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@@ -9560,3 -9556,31 +9556,31 @@@ out_delegees put_nfs4_file(fp); return ERR_PTR(status); } + + /** + * nfsd_update_cmtime_attr - update file's delegated ctime/mtime, + * and optionally other attributes (ie ATTR_ATIME). + * @f: pointer to an opened file + * @flags: any additional flags that should be updated + * + * Given upon opening a file delegated attributes were issues, update + * @f attributes to current times. + */ + void nfsd_update_cmtime_attr(struct file *f, unsigned int flags) + { + int ret; + struct inode *inode = file_inode(f); + struct iattr attr = { + .ia_valid = ATTR_CTIME | ATTR_MTIME | ATTR_DELEG | flags, + }; + + inode_lock(inode); + ret = notify_change(&nop_mnt_idmap, f->f_path.dentry, &attr, NULL); + inode_unlock(inode); + if (ret) + pr_notice_ratelimited("nfsd: Unable to update timestamps on " - "inode %02x:%02x:%lu: %d\n", ++ "inode %02x:%02x:%llu: %d\n", + MAJOR(inode->i_sb->s_dev), + MINOR(inode->i_sb->s_dev), + inode->i_ino, ret); + }