Whamcloud - gitweb
LU-13665 lfs: use correct DST setting for mktime() 06/49206/3
authorMr NeilBrown <neilb@suse.de>
Tue, 22 Nov 2022 05:09:59 +0000 (16:09 +1100)
committerOleg Drokin <green@whamcloud.com>
Tue, 6 Dec 2022 02:44:41 +0000 (02:44 +0000)
commit348e764b9bab92e628dd3dda4861b0068a7cb4f3
tree3bdfd14977833b5f2342725d8a175f18893e88a5
parent6e90974b1f4ac24c5a5d45ecc9bdb4d47018dab4
LU-13665 lfs: use correct DST setting for mktime()

When lfs is passed a "-newerXY" arg when Y=='t' and the arg doesn't
start %H, it leaves ->tm_isdst set to 0 which tells mktime() to assume
that DST is not active.
This means that it produces incorrect results for times when DST is
active.

We should set ->tm_isdst to -1 to tell mktime() that it is not known
whether DST is active.  Then mktime() will use the timezone database
to determine the correct DST setting.

This allows us to re-enable test 56oc on all platforms.

Test-Parameters: trivial clientdistro=sles15sp3 env=ONLY=56
Signed-off-by: Mr NeilBrown <neilb@suse.de>
Change-Id: I94afba96e2563442786726096501c5ec0b40a881
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/49206
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/tests/sanity.sh
lustre/utils/lfs.c