Whamcloud - gitweb
LU-8760 lfsck: fix bit operations lfsck_assistant_data 02/34502/2
authorAlexander Boyko <c17825@cray.com>
Tue, 26 Mar 2019 11:43:14 +0000 (07:43 -0400)
committerOleg Drokin <green@whamcloud.com>
Mon, 8 Apr 2019 05:32:03 +0000 (05:32 +0000)
commitf0ead95dd1275ee906eccdf117abb92b36949a1b
tree19389227f35d22177ba89f1f3e9ed62140ab9a1c
parentc9d03eb6d6026047983f2cb293f72aa9a7bdbb28
LU-8760 lfsck: fix bit operations lfsck_assistant_data

Race between lfsck_master_engine->lfsck_double_scan_generic()
and  lfsck_layout->lfsck_assistant_engine() take a place.
Both threads were sleeping and waiting for each other.
lad_to_double_scan was set before sleep, but lfsck_assistant_data had
zeros
  lad_post_result = 1,
  lad_to_post = 0,
  lad_to_double_scan = 0,
  lad_in_double_scan = 0,
  lad_exit = 0,
  lad_incomplete = 0,

Using
 unsigned int a:1,
           b:1;
  f1() {a = 1;}
  f2() {b = 0;}
is racy for multithread execution. These type of logic requires
atomic bit operations.
The race is lad_to_double_scan vs lad_to_post.

Signed-off-by: Alexander Boyko <c17825@cray.com>
Cray-bug-id: LUS-7076
Change-Id: I4f971ce2acb244f32ae2e108b96995dc2f27e7a3
Reviewed-on: https://review.whamcloud.com/34502
Tested-by: Jenkins
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Andrew Perepechko <c17827@cray.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/lfsck/lfsck_engine.c
lustre/lfsck/lfsck_internal.h
lustre/lfsck/lfsck_layout.c
lustre/lfsck/lfsck_lib.c
lustre/lfsck/lfsck_namespace.c