]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
Merge tag 'nfsd-7.1-1' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux
authorLinus Torvalds <torvalds@linux-foundation.org>
Fri, 15 May 2026 20:11:41 +0000 (13:11 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 15 May 2026 20:11:41 +0000 (13:11 -0700)
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

1  2 
fs/nfsd/nfs4state.c

index c2d13b26a68763dacfff1086f119f92a41fd13db,c92bc0c110650e8bab66e52d7ccda1b963afa754..6837b63d986451c3764ab3d2516e1f92e504d04e
@@@ -9560,3 -9556,31 +9556,31 @@@ out_delegees
        put_nfs4_file(fp);
        return ERR_PTR(status);
  }
 -                                    "inode %02x:%02x:%lu: %d\n",
+ /**
+  * 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:%llu: %d\n",
+                                     MAJOR(inode->i_sb->s_dev),
+                                     MINOR(inode->i_sb->s_dev),
+                                     inode->i_ino, ret);
+ }