summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Farrell <paf@cray.com>2014-06-23 05:32:20 +0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-06-27 04:45:06 +0400
commit09516500cb7555e83aceb9316ce69b0baf6ad1eb (patch)
treeffde1cfac436fc29a2af1ce127083ef7ba40b0af
parentad33b38b5213f4adad5a7a0b054d6000e24400b7 (diff)
downloadlinux-09516500cb7555e83aceb9316ce69b0baf6ad1eb.tar.xz
staging/lustre/vvp: release mmap_sem in error case
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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/staging/lustre/lustre/llite/vvp_io.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/staging/lustre/lustre/llite/vvp_io.c b/drivers/staging/lustre/lustre/llite/vvp_io.c
index 0e0b404cb5e6..04230edc1778 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;