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
..
2022-05-09 16:21:45 -04:00
2024-02-05 20:12:58 +00:00
2022-09-24 07:00:00 +02:00
2022-05-09 16:21:46 -04:00
2024-03-01 13:26:30 +01:00
2023-09-13 09:43:05 +02:00
2022-09-11 20:26:07 -07:00
2024-02-23 09:12:45 +01:00
2023-09-23 11:11:10 +02:00
2022-09-24 07:00:00 +02:00
2022-08-20 11:34:33 -04:00
2023-08-30 16:11:10 +02:00
2022-10-10 14:21:11 -07:00
2022-08-03 10:35:43 -07:00
2023-01-04 11:29:01 +01:00
2022-06-28 13:58:05 -04:00