Whamcloud - gitweb
LU-1042 obdfilter: initialize new object timestamp
authorAndreas Dilger <adilger@whamcloud.com>
Fri, 27 Jan 2012 21:12:06 +0000 (14:12 -0700)
committerOleg Drokin <green@whamcloud.com>
Wed, 15 Feb 2012 16:35:28 +0000 (11:35 -0500)
commitf1deb50672b37a1c87ef5ec93f14ef805e456b2b
tree7c10f3a9aa156c0f4822358c9f85c0ba9fd346a5
parentf7b4054cfc1d30fbbfd56acfe4b5a7a334de8212
LU-1042 obdfilter: initialize new object timestamp

Initialize newly-created objects with a/m/ctime = 0, so that however
clients modify the timestamp it will be updated the first time.  The
fsfilt_ext3_setattr() code will special case ctime = 0 for new files
and reset them to the ext4 s_mkfs_time stored in the superblock.

In LU-221 (commit 414251797ed178eec5d431e1f5aa4a889d2b159f) the
timestamps were initialized to (INT_MIN + 24 * 3600) (1901-12-14),
but the use of unsigned on-disk timestamps caused these negative
numbers to be transformed into large positive numbers (debugfs
reports them to be "Tue Jan 19 20:14:08 2038").  Add a fix so that
files with this exact timestamp have the timestamp reset to 0.

Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: I22f2cd443402c0c524bafaf37c80cad7b6d00c1e
Reviewed-on: http://review.whamcloud.com/2036
Reviewed-by: Johann Lombardi <johann@whamcloud.com>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/include/lustre_fsfilt.h
lustre/lvfs/fsfilt_ext3.c
lustre/obdfilter/filter.c