Whamcloud - gitweb
LU-7276 utils: fix llog_reader loop on empty log 27/17627/4
authorAndreas Dilger <andreas.dilger@intel.com>
Thu, 24 Jul 2014 20:19:08 +0000 (14:19 -0600)
committerOleg Drokin <oleg.drokin@intel.com>
Mon, 18 Jan 2016 05:58:43 +0000 (05:58 +0000)
commitade3d1ee9494af32f4e022e30757318a94b7ee96
tree252d4f5ca9f79266a15eaf2d9750b52f06977296
parent9ab698e4d99103b2fecf19b0fd3f90d28723e9d1
LU-7276 utils: fix llog_reader loop on empty log

If llog_reader tries to read an empty log file (0 bytes) it does not
detect this as an error, since it tries to read 0 bytes from the llog
and then tries to parse an empty llog header.

Return an error if the llog file is smaller than struct llog_log_hdr.

Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Change-Id: Ife482eb6d73b35f09cc70ca4b79bfd7b053ebb35
Reviewed-on: http://review.whamcloud.com/17627
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Frank Zago <fzago@cray.com>
Reviewed-by: Olaf Faaland-LLNL <faaland1@llnl.gov>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/utils/llog_reader.c