From 2bb6cc573fc2806b5299edfe3df8fe4730db81bf Mon Sep 17 00:00:00 2001 From: Ameer Hamza Date: Tue, 26 May 2026 19:38:57 +0500 Subject: [PATCH] Revert "Add handling for STATX_CHANGE_COOKIE (#343)" This reverts commit 367695fb13b0c6d5b3dccef9f33513d848542a1a. Signed-off-by: Ameer Hamza (cherry picked from commit 6c071ca06b6ac8bd8e06cc91315a5e7391f6b4d5) --- module/os/linux/zfs/zfs_vnops_os.c | 13 +------------ module/os/linux/zfs/zpl_inode.c | 26 -------------------------- 2 files changed, 1 insertion(+), 38 deletions(-) diff --git a/module/os/linux/zfs/zfs_vnops_os.c b/module/os/linux/zfs/zfs_vnops_os.c index 9c530b9e9406..5ce5c92a37f9 100644 --- a/module/os/linux/zfs/zfs_vnops_os.c +++ b/module/os/linux/zfs/zfs_vnops_os.c @@ -2614,19 +2614,8 @@ zfs_setattr(znode_t *zp, vattr_t *vap, int flags, cred_t *cr, zidmap_t *mnt_ns) if (fuid_dirtied) zfs_fuid_sync(zfsvfs, tx); - if (mask != 0) { + if (mask != 0) zfs_log_setattr(zilog, tx, TX_SETATTR, zp, vap, mask, fuidp); - /* - * Ensure that the z_seq is always incremented on setattr - * operation. This is required for change accounting for - * NFS clients. - * - * ATTR_MODE already increments via zfs_acl_chmod_setattr. - * ATTR_SIZE already increments via zfs_freesp. - */ - if (!(mask & (ATTR_MODE | ATTR_SIZE))) - zp->z_seq++; - } mutex_exit(&zp->z_lock); if (mask & (ATTR_UID|ATTR_GID|ATTR_MODE)) diff --git a/module/os/linux/zfs/zpl_inode.c b/module/os/linux/zfs/zpl_inode.c index 02efc86ee5f6..b3f8f708af17 100644 --- a/module/os/linux/zfs/zpl_inode.c +++ b/module/os/linux/zfs/zpl_inode.c @@ -506,32 +506,6 @@ zpl_getattr_impl(const struct path *path, struct kstat *stat, u32 request_mask, } #endif -#ifdef STATX_CHANGE_COOKIE - if (request_mask & STATX_CHANGE_COOKIE) { - /* - * knfsd uses the STATX_CHANGE_COOKIE to surface to clients - * change_info4 data, which is used to implement NFS client - * name caching (see RFC 8881 Section 10.8). This number - * should always increase with changes and should not be - * reused. We cannot simply present ctime here because - * ZFS uses a coarse timer to set them, which may cause - * clients to fail to detect changes and invalidate cache. - * - * ZFS always increments znode z_seq number, but this is - * uint_t and so we mask in ctime to upper bits. - * - * STATX_ATTR_CHANGE_MONOTONIC is advertised - * to prevent knfsd from generating the change cookie - * based on ctime. C.f. nfsd4_change_attribute in - * fs/nfsd/nfsfh.c. - */ - stat->change_cookie = - ((u64)stat->ctime.tv_sec << 32) | zp->z_seq; - stat->attributes |= STATX_ATTR_CHANGE_MONOTONIC; - stat->result_mask |= STATX_CHANGE_COOKIE; - } -#endif - #ifdef STATX_DIOALIGN if (request_mask & STATX_DIOALIGN) { uint64_t align;