[LU-7567] lfs_changelog() misprints timestamps Created: 16/Dec/15  Updated: 26/Apr/21  Resolved: 12/May/17

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: Lustre 2.8.0
Fix Version/s: Lustre 2.10.0

Type: Bug Priority: Minor
Reporter: John Hammond Assignee: WC Triage
Resolution: Fixed Votes: 0
Labels: easy, lfs, patch

Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   

The cr_time field of a changelog record is (secs << 30) + nsecs. So lfs_changelog() should use ".09d" when printing the fractional part. Instead it uses ".06d":

		secs = rec->cr_time >> 30;
                gmtime_r(&secs, &ts);
		printf(LPU64" %02d%-5s %02d:%02d:%02d.%06d %04d.%02d.%02d "
		       "0x%x t="DFID, rec->cr_index, rec->cr_type,
        	       changelog_type2str(rec->cr_type),
                       ts.tm_hour, ts.tm_min, ts.tm_sec,
		       (int)(rec->cr_time & ((1<<30) - 1)),
                       ts.tm_year + 1900, ts.tm_mon + 1, ts.tm_mday,
		       rec->cr_flags & CLF_FLAGMASK, PFID(&rec->cr_tfid));


 Comments   
Comment by Gerrit Updater [ 14/Jan/16 ]

akam kumar bharathi (azurelustre@gmail.com) uploaded a new patch: http://review.whamcloud.com/18006
Subject: LU-7567 lfs_changelog() misprints timestamps
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: 27664766c341c0824c3447b5d32d4f92324e6ed5

Comment by Gerrit Updater [ 12/May/17 ]

Oleg Drokin (oleg.drokin@intel.com) merged in patch https://review.whamcloud.com/18006/
Subject: LU-7567 utils: fix timestamp printing in lfs_changelog()
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: 47380f67e9e21114020937c5afdb81c5c83f4fcd

Comment by Peter Jones [ 12/May/17 ]

Landed for 2.10

Generated at Sat Feb 10 02:10:00 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.