android_kernel_xiaomi_sm8450/fs/nfsd
Tavian Barnes 8ef87fe6e8 nfsd: Fix creation time serialization order
[ Upstream commit d7dbed457c2ef83709a2a2723a2d58de43623449 ]

In nfsd4_encode_fattr(), TIME_CREATE was being written out after all
other times.  However, they should be written out in an order that
matches the bit flags in bmval1, which in this case are

    #define FATTR4_WORD1_TIME_ACCESS        (1UL << 15)
    #define FATTR4_WORD1_TIME_CREATE        (1UL << 18)
    #define FATTR4_WORD1_TIME_DELTA         (1UL << 19)
    #define FATTR4_WORD1_TIME_METADATA      (1UL << 20)
    #define FATTR4_WORD1_TIME_MODIFY        (1UL << 21)

so TIME_CREATE should come second.

I noticed this on a FreeBSD NFSv4.2 client, which supports creation
times.  On this client, file times were weirdly permuted.  With this
patch applied on the server, times looked normal on the client.

Fixes: e377a3e698fb ("nfsd: Add support for the birth time attribute")
Link: https://unix.stackexchange.com/q/749605/56202
Signed-off-by: Tavian Barnes <tavianator@tavianator.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-06-21 14:54:14 +02:00
..
acl.h NFSD: add posix ACLs to struct nfsd_attrs 2024-06-21 14:53:55 +02:00
auth.c nfsd: auth: Fix gid sorting when rootsquash enabled 2018-01-22 20:13:07 -08:00
auth.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
blocklayout.c nfsd: move nfserrno() to vfs.c 2024-06-21 14:54:05 +02:00
blocklayoutxdr.c nfsd: move nfserrno() to vfs.c 2024-06-21 14:54:05 +02:00
blocklayoutxdr.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
cache.h nfsd: use DEFINE_SHOW_ATTRIBUTE to define nfsd_reply_cache_stats_fops 2024-06-21 14:54:01 +02:00
current_stateid.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
export.c nfsd: report per-export stats 2024-06-21 14:52:56 +02:00
export.h nfsd: move nfserrno() to vfs.c 2024-06-21 14:54:05 +02:00
fault_inject.c nfsd: no need to check return value of debugfs_create functions 2019-07-03 16:57:17 +02:00
filecache.c NFSD: Fix problem of COMMIT and NFS4ERR_DELAY in infinite loop 2024-06-21 14:54:14 +02:00
filecache.h NFSD: Convert filecache to rhltable 2024-06-21 14:54:13 +02:00
flexfilelayout.c nfsd: move nfserrno() to vfs.c 2024-06-21 14:54:05 +02:00
flexfilelayoutxdr.c NFSD: da_addr_body field missing in some GETDEVICEINFO replies 2023-09-19 12:20:15 +02:00
flexfilelayoutxdr.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
idmap.h nfsd: Remove duplicate define of IDMAP_NAMESZ/IDMAP_TYPE_xx 2015-07-20 14:58:46 -04:00
Kconfig nfsd: allow disabling NFSv2 at compile time 2024-06-21 14:54:05 +02:00
lockd.c NFSD: simplify struct nfsfh 2024-06-21 14:53:25 +02:00
Makefile nfsd: allow disabling NFSv2 at compile time 2024-06-21 14:54:05 +02:00
netns.h NFSD: replace delayed_work with work_struct for nfsd_client_shrinker 2024-06-21 14:54:10 +02:00
nfs2acl.c NFSD: Finish converting the NFSv2 GETACL result encoder 2024-06-21 14:54:04 +02:00
nfs3acl.c NFSD: Finish converting the NFSv3 GETACL result encoder 2024-06-21 14:54:04 +02:00
nfs3proc.c NFSD: Add an NFSD_FILE_GC flag to enable nfsd_file garbage collection 2024-06-21 14:54:05 +02:00
nfs3xdr.c NFSD: Clean up WRITE arg decoders 2024-06-21 14:54:00 +02:00
nfs4acl.c NFSD: add posix ACLs to struct nfsd_attrs 2024-06-21 14:53:55 +02:00
nfs4callback.c NFSD: add support for sending CB_RECALL_ANY 2024-06-21 14:54:09 +02:00
nfs4idmap.c nfsd: move nfserrno() to vfs.c 2024-06-21 14:54:05 +02:00
nfs4layouts.c NFSD: Add tracepoints to report NFSv4 callback completions 2024-06-21 14:53:59 +02:00
nfs4proc.c NFSD: fix problems with cleanup on errors in nfsd4_copy 2024-06-21 14:54:11 +02:00
nfs4recover.c nfsd: Propagate some error code returned by memdup_user() 2024-06-21 14:53:57 +02:00
nfs4state.c nfsd: fix courtesy client with deny mode handling in nfs4_upgrade_open 2024-06-21 14:54:11 +02:00
nfs4xdr.c nfsd: Fix creation time serialization order 2024-06-21 14:54:14 +02:00
nfscache.c nfsd: use DEFINE_SHOW_ATTRIBUTE to define nfsd_reply_cache_stats_fops 2024-06-21 14:54:01 +02:00
nfsctl.c nfsd: fix double fget() bug in __write_ports_addfd() 2024-06-21 14:54:14 +02:00
nfsd.h NFSD: register/unregister of nfsd-client shrinker at nfsd startup/shutdown time 2024-06-21 14:54:10 +02:00
nfsfh.c NFSD: discard fh_locked flag and fh_lock/fh_unlock 2024-06-21 14:53:56 +02:00
nfsfh.h NFSD: Use const pointers as parameters to fh_ helpers 2024-06-21 14:54:06 +02:00
nfsproc.c NFSD: Use set_bit(RQ_DROPME) 2024-06-21 14:54:10 +02:00
nfssvc.c NFSD: copy the whole verifier in nfsd_copy_write_verifier 2024-06-21 14:54:12 +02:00
nfsxdr.c NFSD: Clean up WRITE arg decoders 2024-06-21 14:54:00 +02:00
pnfs.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
state.h NFSD: add delegation reaper to react to low memory condition 2024-06-21 14:54:09 +02:00
stats.c nfsd: use DEFINE_PROC_SHOW_ATTRIBUTE to define nfsd_proc_ops 2024-06-21 14:54:01 +02:00
stats.h nfsd: make nfsd_stats.th_cnt atomic_t 2024-06-21 14:53:29 +02:00
trace.c NFSD: Add SPDX header for fs/nfsd/trace.c 2024-06-21 14:52:33 +02:00
trace.h nfsd: don't fsync nfsd_files on last close 2024-06-21 14:54:11 +02:00
vfs.c nfsd: make a copy of struct iattr before calling notify_change 2024-06-21 14:54:14 +02:00
vfs.h NFSD: Pass the target nfsd_file to nfsd_commit() 2024-06-21 14:54:05 +02:00
xdr3.h SUNRPC: Change return value type of .pc_encode 2024-06-21 14:53:26 +02:00
xdr4.h NFSD: enhance inter-server copy cleanup 2024-06-21 14:54:10 +02:00
xdr4cb.h NFSD: add support for sending CB_RECALL_ANY 2024-06-21 14:54:09 +02:00
xdr.h SUNRPC: Change return value type of .pc_encode 2024-06-21 14:53:26 +02:00