Whamcloud - gitweb
LU-12420 utils: llog_reader handles uninitialized mountdata 78/35178/2
authorLi Xi <lixi@ddn.com>
Tue, 11 Jun 2019 12:28:30 +0000 (20:28 +0800)
committerOleg Drokin <green@whamcloud.com>
Tue, 25 Jun 2019 01:55:29 +0000 (01:55 +0000)
commit46f53da979344c88ab985de7227a81240a8107bf
tree3d7bf1ce50909c37a0589a73fa1b4ef0c19d1105
parent94a16a027536100a9d0a279e1f384076a7a9b513
LU-12420 utils: llog_reader handles uninitialized mountdata

When reading an mountdata that has never been used, "llog_reader
CONFIGS/mountdata" command crashes with following output:

Header size : 500170753
Time : Wed Sep  4 00:57:37 6869
Number of records: 65534
Target uuid :
-----------------------
Segmentation fault

After apply this patch, llog_reader will print following message
and quit under this circumstance:

Header size : 500170753
Time : Wed Sep  4 00:57:37 6869
Number of records: 65534
Target uuid :
-----------------------
uninitialized llog record at index 0

Change-Id: I25147f7fd09c6d59ff0049bdb20ac1979cf43ee4
Signed-off-by: Li Xi <lixi@ddn.com>
Reviewed-on: https://review.whamcloud.com/35178
Tested-by: Jenkins
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Wang Shilong <wshilong@ddn.com>
Reviewed-by: Li Dongyang <dongyangli@ddn.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/utils/llog_reader.c