Skip to content

Commit ec5aa9b

Browse files
authored
Merge pull request #392 from truenas/NAS-141170
NAS-141170 / 25.10.4 / Revert "Add handling for STATX_CHANGE_COOKIE (#343)"
2 parents abf9190 + 6fcb92c commit ec5aa9b

2 files changed

Lines changed: 1 addition & 38 deletions

File tree

module/os/linux/zfs/zfs_vnops_os.c

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2613,19 +2613,8 @@ zfs_setattr(znode_t *zp, vattr_t *vap, int flags, cred_t *cr, zidmap_t *mnt_ns)
26132613
if (fuid_dirtied)
26142614
zfs_fuid_sync(zfsvfs, tx);
26152615

2616-
if (mask != 0) {
2616+
if (mask != 0)
26172617
zfs_log_setattr(zilog, tx, TX_SETATTR, zp, vap, mask, fuidp);
2618-
/*
2619-
* Ensure that the z_seq is always incremented on setattr
2620-
* operation. This is required for change accounting for
2621-
* NFS clients.
2622-
*
2623-
* ATTR_MODE already increments via zfs_acl_chmod_setattr.
2624-
* ATTR_SIZE already increments via zfs_freesp.
2625-
*/
2626-
if (!(mask & (ATTR_MODE | ATTR_SIZE)))
2627-
zp->z_seq++;
2628-
}
26292618

26302619
mutex_exit(&zp->z_lock);
26312620
if (mask & (ATTR_UID|ATTR_GID|ATTR_MODE))

module/os/linux/zfs/zpl_inode.c

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -506,32 +506,6 @@ zpl_getattr_impl(const struct path *path, struct kstat *stat, u32 request_mask,
506506
}
507507
#endif
508508

509-
#ifdef STATX_CHANGE_COOKIE
510-
if (request_mask & STATX_CHANGE_COOKIE) {
511-
/*
512-
* knfsd uses the STATX_CHANGE_COOKIE to surface to clients
513-
* change_info4 data, which is used to implement NFS client
514-
* name caching (see RFC 8881 Section 10.8). This number
515-
* should always increase with changes and should not be
516-
* reused. We cannot simply present ctime here because
517-
* ZFS uses a coarse timer to set them, which may cause
518-
* clients to fail to detect changes and invalidate cache.
519-
*
520-
* ZFS always increments znode z_seq number, but this is
521-
* uint_t and so we mask in ctime to upper bits.
522-
*
523-
* STATX_ATTR_CHANGE_MONOTONIC is advertised
524-
* to prevent knfsd from generating the change cookie
525-
* based on ctime. C.f. nfsd4_change_attribute in
526-
* fs/nfsd/nfsfh.c.
527-
*/
528-
stat->change_cookie =
529-
((u64)stat->ctime.tv_sec << 32) | zp->z_seq;
530-
stat->attributes |= STATX_ATTR_CHANGE_MONOTONIC;
531-
stat->result_mask |= STATX_CHANGE_COOKIE;
532-
}
533-
#endif
534-
535509
#ifdef STATX_DIOALIGN
536510
if (request_mask & STATX_DIOALIGN) {
537511
uint64_t align;

0 commit comments

Comments
 (0)