diff options
author | majianpeng <majianpeng@gmail.com> | 2013-07-16 07:36:21 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-09-26 20:18:29 -0400 |
commit | 4f8e2fc10e249dcae05898f4807d9cc450b070bb (patch) | |
tree | 5ff11a8d9ac02996802e921ed31fdc1b51636463 | |
parent | fd5e2dea537bbf0bfb09f79a8b34c148bb502735 (diff) |
ceph: Don't forget the 'up_read(&osdc->map_sem)' if met error.
commit 494ddd11be3e2621096bb425eed2886f8e8446d4 upstream.
Signed-off-by: Jianpeng Ma <majianpeng@gmail.com>
Reviewed-by: Sage Weil <sage@inktank.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | fs/ceph/ioctl.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/ceph/ioctl.c b/fs/ceph/ioctl.c index e0b4ef31d3c8..a5ce62eb7806 100644 --- a/fs/ceph/ioctl.c +++ b/fs/ceph/ioctl.c | |||
@@ -196,8 +196,10 @@ static long ceph_ioctl_get_dataloc(struct file *file, void __user *arg) | |||
196 | r = ceph_calc_file_object_mapping(&ci->i_layout, dl.file_offset, len, | 196 | r = ceph_calc_file_object_mapping(&ci->i_layout, dl.file_offset, len, |
197 | &dl.object_no, &dl.object_offset, | 197 | &dl.object_no, &dl.object_offset, |
198 | &olen); | 198 | &olen); |
199 | if (r < 0) | 199 | if (r < 0) { |
200 | up_read(&osdc->map_sem); | ||
200 | return -EIO; | 201 | return -EIO; |
202 | } | ||
201 | dl.file_offset -= dl.object_offset; | 203 | dl.file_offset -= dl.object_offset; |
202 | dl.object_size = ceph_file_layout_object_size(ci->i_layout); | 204 | dl.object_size = ceph_file_layout_object_size(ci->i_layout); |
203 | dl.block_size = ceph_file_layout_su(ci->i_layout); | 205 | dl.block_size = ceph_file_layout_su(ci->i_layout); |