Tavian Barnes 806a0a1819 nfsd: Fix creation time serialization order
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-03-26 18:20:24 -04:00
..
2024-03-06 14:45:15 +00:00
2021-12-03 18:44:06 +01:00
2024-03-06 14:45:15 +00:00
2021-10-02 15:51:10 -04:00
2022-09-26 14:02:47 -04:00
2024-03-06 14:45:15 +00:00
2022-10-06 17:13:18 -07:00
2024-03-06 14:45:17 +00:00
2022-09-26 14:02:47 -04:00
2021-12-13 13:42:51 -05:00
2024-03-06 14:45:17 +00:00
2024-03-06 14:45:15 +00:00
2024-03-06 14:45:15 +00:00