Commit 0e5fd06c authored by Patrick Farrell's avatar Patrick Farrell Committed by Greg Kroah-Hartman

staging/lustre/llite: take trunc_sem only at vvp layer

The lli_trunc_sem is taken in 'read' mode in both
ll_page_mkwrite and vvp_io_fault_start. This can lead to a
deadlock with another thread which asks for the semaphore
in write mode between thse two read calls.

Since all users of lli_trunc_sem are in the vvp layer, we
can satisfy the requirement to exclude truncate by taking
the semaphore only in vvp_io_fault_start.
Signed-off-by: default avatarPatrick Farrell <>
Intel-bug-id: default avatarJinshan Xiong <>
Reviewed-by: default avatarAndriy Skulysh <>
Signed-off-by: default avatarOleg Drokin <>
Signed-off-by: default avatarGreg Kroah-Hartman <>
parent 81ea39ec
......@@ -196,18 +196,11 @@ static int ll_page_mkwrite0(struct vm_area_struct *vma, struct page *vmpage,
set = cfs_block_sigsinv(sigmask(SIGKILL) | sigmask(SIGTERM));
/* we grab lli_trunc_sem to exclude truncate case.
* Otherwise, we could add dirty pages into osc cache
* while truncate is on-going.
inode = vvp_object_inode(io->ci_obj);
lli = ll_i2info(inode);
result = cl_io_loop(env, io);
if (result == 0) {
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment