[LU-12420] llog_reader crashes when reading llog that is not inited Created: 11/Jun/19  Updated: 26/Aug/22  Resolved: 25/Jun/19

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

Type: Bug Priority: Minor
Reporter: Li Xi Assignee: Li Xi
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Related
is related to LU-6932 llog_reader segfault on corrupted file Resolved
Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   

I think the problem is easy to reproduce. On a Lustre file system that doesn't have nodemap configured, which is the majority case I think, do the following:

  1. mount -t ldiskfs $MGT $MNT
  2. llog_reader $MNT/CONFIGS/nodemap
    llog_reader will quit with following error:
 llog_reader: Error allocating -16 bytes for recs_buf: Cannot allocate memory (12)
 llog_reader: Could not pack buffer.: Cannot allocate memory (12)

Apparently, the llog of nodemap is never initialized so all the values are gabage.

Header size : 3987452397
Time : Fri Jan 2 20:30:12 1970
Number of records: 4294967295
Target uuid :

I think in this case, llog_reader should just quit with proper message printed.



 Comments   
Comment by Gerrit Updater [ 11/Jun/19 ]

Li Xi (lixi@ddn.com) uploaded a new patch: https://review.whamcloud.com/35177
Subject: LU-12420 utils: llog_reader handles uninitialized llog properly
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: 6adef13baa9ce18da9a164b79924f298c000574c

Comment by Gerrit Updater [ 11/Jun/19 ]

Li Xi (lixi@ddn.com) uploaded a new patch: https://review.whamcloud.com/35178
Subject: LU-12420 utils: llog_reader handles uninitialized mountdata
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: ad12f4bbd1f37c48663a049308414a726e05c3df

Comment by Gerrit Updater [ 25/Jun/19 ]

Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/35177/
Subject: LU-12420 utils: llog_reader handles uninitialized llog properly
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: 94a16a027536100a9d0a279e1f384076a7a9b513

Comment by Gerrit Updater [ 25/Jun/19 ]

Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/35178/
Subject: LU-12420 utils: llog_reader handles uninitialized mountdata
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: 46f53da979344c88ab985de7227a81240a8107bf

Comment by Li Xi [ 25/Jun/19 ]

I am closing this ticket since all two patches are merged.

Comment by Gerrit Updater [ 23/Aug/22 ]

"Etienne AUJAMES <eaujames@ddn.com>" uploaded a new patch: https://review.whamcloud.com/48302
Subject: LU-12420 utils: llog_reader handles uninitialized llog properly
Project: fs/lustre-release
Branch: b2_12
Current Patch Set: 1
Commit: baae76f7f248d841c400d36a59f5c82ca6729a4c

Comment by Gerrit Updater [ 23/Aug/22 ]

"Etienne AUJAMES <eaujames@ddn.com>" uploaded a new patch: https://review.whamcloud.com/48303
Subject: LU-12420 utils: llog_reader handles uninitialized mountdata
Project: fs/lustre-release
Branch: b2_12
Current Patch Set: 1
Commit: 687bffe3e462764cf25015e53de9bc1d687c130a

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