staging/lustre/llite: deadlock taking lli_trunc_sem during file write
authorBobi Jam <bobijam.xu@intel.com>
Sun, 27 Apr 2014 17:06:45 +0000 (13:06 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 27 Apr 2014 17:24:53 +0000 (10:24 -0700)
commit178ba1e0d00aca671f9a8f5f41d28fc0fe717752
tree21a8d6f534062c7534a4deeb19064b3ca79d58ba
parent8d97deb97dde884eb08d0c3b69ccfcc5a43b1350
staging/lustre/llite: deadlock 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>
Reviewed-on: http://review.whamcloud.com/9267
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4627
Reviewed-by: Lai Siyao <lai.siyao@intel.com>
Signed-off-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lustre/llite/llite_lib.c