Whamcloud - gitweb
LU-4627 llite: deed taking lli_trunc_sem during file write 67/9267/4
authorBobi Jam <bobijam.xu@intel.com>
Thu, 13 Feb 2014 15:27:41 +0000 (23:27 +0800)
committerOleg Drokin <oleg.drokin@intel.com>
Mon, 10 Mar 2014 23:40:56 +0000 (23:40 +0000)
commit1601e8591c1334ee7879bb6daac09342caa4a542
tree28c3f45260018d9bdfdeca5952166bddc8bd3625
parent155031eeacbb4b79fec7cc2a811afcba9fb39d7a
LU-4627 llite: deed taking lli_trunc_sem during file write

File write before io loop will take lli_trun_sem read semaphore to
protect osc_extent, while after generic_file_aio_write() done, it
could possible need to kill suid or sgid, which will call
ll_setattr_raw() to change the inode's attribute, and it does not
involve size.

So the ll_truc_sem write semaphore should be constrained
around ll_setattr_ost() to not come across the lli_trunc_sem read
semaphore get from the normal file write path.

Signed-off-by: Bobi Jam <bobijam.xu@intel.com>
Change-Id: Ic7f9cfb6d76dcf7ad08635efab154e7cdc392ce8
Reviewed-on: http://review.whamcloud.com/9267
Tested-by: Jenkins
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Lai Siyao <lai.siyao@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/llite/llite_lib.c