staging/lustre/llite: Solve a race to access lli_has_smd in read case
authorJinshan Xiong <jinshan.xiong@intel.com>
Mon, 2 Feb 2015 02:52:13 +0000 (21:52 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 7 Feb 2015 09:32:33 +0000 (17:32 +0800)
commit4c309612ddb9107c3fdbd5233198d59708114bc4
treef192b5630ac257ac549d13635ca98e10c19e25fa
parentd27f9b077e113b0fa46e466465233a5e51085228
staging/lustre/llite: Solve a race to access lli_has_smd in read case

In vvp_io_read_lock(), it used to decide if to add read lock by
checking lli_has_smd. Accessing lli_has_smd is racy when an empty
file is turned into raid0, therefore, it may result in read requests
are issued without corresponding lock.

Signed-off-by: Jinshan Xiong <jinshan.xiong@intel.com>
Reviewed-on: http://review.whamcloud.com/12139
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5062
Reviewed-by: Bobi Jam <bobijam@gmail.com>
Signed-off-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lustre/include/lclient.h
drivers/staging/lustre/lustre/lclient/lcommon_cl.c
drivers/staging/lustre/lustre/llite/vvp_io.c
drivers/staging/lustre/lustre/llite/vvp_lock.c