lkml.org 
[lkml]   [2014]   [Jun]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 16/18] staging/lustre/vvp: release mmap_sem in error case
Date
From: Patrick Farrell <paf@cray.com>

The mmap_sem is downed in vvp_mmap_locks, but in case of
error from cl_io_lock_alloc_add, it is not upped.

Credit to Paul Casella at Cray for finding this.

Signed-off-by: Patrick Farrell <paf@cray.com>
Reviewed-on: http://review.whamcloud.com/10741
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5221
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Oleg Drokin <oleg.drokin@intel.com>
---
drivers/staging/lustre/lustre/llite/vvp_io.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/lustre/lustre/llite/vvp_io.c b/drivers/staging/lustre/lustre/llite/vvp_io.c
index 0e0b404..04230ed 100644
--- a/drivers/staging/lustre/lustre/llite/vvp_io.c
+++ b/drivers/staging/lustre/lustre/llite/vvp_io.c
@@ -269,8 +269,10 @@ static int vvp_mmap_locks(const struct lu_env *env,
descr->cld_mode, descr->cld_start,
descr->cld_end);

- if (result < 0)
+ if (result < 0) {
+ up_read(&mm->mmap_sem);
return result;
+ }

if (vma->vm_end - addr >= count)
break;
--
1.9.0


\
 
 \ /
  Last update: 2014-06-23 04:01    [W:1.119 / U:0.304 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site