Whamcloud - gitweb
LU-1876 hsm: Avoid deadlock on i_mutex and layout change
authorJinshan Xiong <jinshan.xiong@intel.com>
Thu, 24 Jan 2013 21:28:21 +0000 (14:28 -0700)
committerOleg Drokin <green@whamcloud.com>
Thu, 31 Jan 2013 16:17:16 +0000 (11:17 -0500)
commitb60a6044209912bdbbaab3d7ecc96b9d13129807
treee7f29182aafb3dbf75a4c1cc7d87947242cdd377
parentdf8d26f186c1726ddf50a39d82b02a6b685b8d2b
LU-1876 hsm: Avoid deadlock on i_mutex and layout change

The deadlock is as follows:
Proc 1 (write): start an IO -> try to acquire i_mutex in
            generic_file_aio_write()
Proc 2 (setattr): Acquire i_mutex in ll_setattr_raw -> initialise IO
            -> ll_layout_refresh() -> wait for IO above.

It's actually not necessary to acquire i_mutex in ll_setattr_raw()
until setattr really starts.

Signed-off-by: Jinshan Xiong <jinshan.xiong@intel.com>
Change-Id: I1988d67eab8bcac2ee63b9ec0ecab06d0b7cfc66
Reviewed-on: http://review.whamcloud.com/5159
Tested-by: Hudson
Reviewed-by: jacques-Charles Lafoucriere <jacques-charles.lafoucriere@cea.fr>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Johann Lombardi <johann.lombardi@intel.com>
lustre/include/lclient.h
lustre/llite/llite_lib.c
lustre/llite/vvp_io.c