aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/lustre/lustre/llite/llite_mmap.c
diff options
context:
space:
mode:
authorPatrick Farrell <paf@cray.com>2016-06-20 16:55:35 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-06-20 14:28:39 -0700
commit0e5fd06ca069a8edc32a035add93112f6681dd72 (patch)
treeefdf6e7c7b0d8b2fdd751157a03d8edfe8bf5d1a /drivers/staging/lustre/lustre/llite/llite_mmap.c
parentstaging/lustre/ptlrpc: lost bulk leads to a hang (diff)
downloadlinux-dev-0e5fd06ca069a8edc32a035add93112f6681dd72.tar.xz
linux-dev-0e5fd06ca069a8edc32a035add93112f6681dd72.zip
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: Patrick Farrell <paf@cray.com> Reviewed-on: http://review.whamcloud.com/19315 Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7981 Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com> Reviewed-by: Andriy Skulysh <andriy.skulysh@seagate.com> Signed-off-by: Oleg Drokin <green@linuxhacker.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/lustre/lustre/llite/llite_mmap.c')
-rw-r--r--drivers/staging/lustre/lustre/llite/llite_mmap.c7
1 files changed, 0 insertions, 7 deletions
diff --git a/drivers/staging/lustre/lustre/llite/llite_mmap.c b/drivers/staging/lustre/lustre/llite/llite_mmap.c
index fb1c3b613f59..66ee5db5fce8 100644
--- a/drivers/staging/lustre/lustre/llite/llite_mmap.c
+++ b/drivers/staging/lustre/lustre/llite/llite_mmap.c
@@ -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);
- down_read(&lli->lli_trunc_sem);
result = cl_io_loop(env, io);
- up_read(&lli->lli_trunc_sem);
-
cfs_restore_sigs(set);
if (result == 0) {