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)
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>

No differences found