Whamcloud - gitweb
LU-11392 llog: fix race llog_process_thread vs llog_add 93/33193/3
authorAlexander Boyko <c17825@cray.com>
Tue, 18 Sep 2018 13:13:36 +0000 (09:13 -0400)
committerOleg Drokin <green@whamcloud.com>
Fri, 5 Oct 2018 22:25:55 +0000 (22:25 +0000)
commit38c5f9aa6cb5f98f684e8bbe67ec3bd8e2204467
tree132cfa273e04dc3ff69be9a0c499259f0e4fb29c
parentf651470c13f83bc11237e12f6fdce9cdbf96561b
LU-11392 llog: fix race llog_process_thread vs llog_add

The llog should be wrapped so it has old data on disk and zero at
bitmap.
  1. llog_process_thread reads part of llog at buffer.
  1. process a last record, checks the next record fields
  2. llog_add adds a record and marks new record at bitmap
  1. check bitmap flag and process the old record from buffer

After LU-7001 small window for the race still exists. It locates
between partial_chunk check and ext2_test_bit.
The patch fixes this race.

Cray-bug-id: LUS-6287
Signed-off-by: Alexander Boyko <c17825@cray.com>
Change-Id: I45a742af0c987aa159a22a3255a4fb9d430b6a84
Reviewed-on: https://review.whamcloud.com/33193
Tested-by: Jenkins
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Alexander Zarochentsev <c17826@cray.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/obdclass/llog.c