From patchwork Tue Jul 16 11:36:21 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: majianpeng X-Patchwork-Id: 2828082 Return-Path: X-Original-To: patchwork-ceph-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 74C9A9F7D6 for ; Tue, 16 Jul 2013 11:38:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 039822017F for ; Tue, 16 Jul 2013 11:38:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7C97A2015D for ; Tue, 16 Jul 2013 11:38:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932182Ab3GPLi2 (ORCPT ); Tue, 16 Jul 2013 07:38:28 -0400 Received: from mail-pd0-f173.google.com ([209.85.192.173]:62388 "EHLO mail-pd0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932108Ab3GPLi1 (ORCPT ); Tue, 16 Jul 2013 07:38:27 -0400 Received: by mail-pd0-f173.google.com with SMTP id v14so582404pde.18 for ; Tue, 16 Jul 2013 04:38:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:reply-to:subject:x-priority:x-guid:x-has-attach :x-mailer:mime-version:message-id:content-type :content-transfer-encoding; bh=iSYrXKAHOvnKbXStFOfPUUmwm7Q/DxMPCZP1yYqbH1E=; b=wNGN3WMeka0yn0bA6q7oh4XNK67W2kAefUUixKvyGRD/Z/gPkXT4iCsvVwnCD+gyW1 n1PVNaWmFePKNN3M3lf65PLWJv6nQRGcVSoQqxu3+2DevpLZDr67o5KaIHWEqSzPAFNW 5xQtUva89gYG+HPh8jWW8T5IdVlAM2YeaKKh/XmzY9z6/5UijjsWISo4D2N7qVo068CC OCEGIwWRyORjO60DKbt/XMIUuEFHNhq5xeDM+J9vXzHAMOakgKxPR5nqrQeV4qki77we Bi5LtrWy3mDxvdyTTbUq+bIFzbQ+oUQF00GSXlEqUn2mEifwTZAkWKz+v8tcN7shcL6v qFwA== X-Received: by 10.66.186.14 with SMTP id fg14mr2145880pac.166.1373974706379; Tue, 16 Jul 2013 04:38:26 -0700 (PDT) Received: from majianpeng ([218.242.10.182]) by mx.google.com with ESMTPSA id nv6sm1579184pbc.6.2013.07.16.04.36.22 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 16 Jul 2013 04:38:25 -0700 (PDT) Date: Tue, 16 Jul 2013 19:36:21 +0800 From: majianpeng To: sage Cc: ceph-devel Reply-To: majianpeng Subject: [PATCH] ceph: Don't forget the 'up_read(&osdc->map_sem)' if met error. X-Priority: 3 X-GUID: 507DE931-CB93-42B7-BF83-9E6FF81AAC2A X-Has-Attach: no X-Mailer: Foxmail 7.0.1.90[en] Mime-Version: 1.0 Message-ID: <201307161936127882610@gmail.com> Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Jianpeng Ma --- fs/ceph/ioctl.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- 1.8.1.2 diff --git a/fs/ceph/ioctl.c b/fs/ceph/ioctl.c index e0b4ef3..a5ce62e 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) r = ceph_calc_file_object_mapping(&ci->i_layout, dl.file_offset, len, &dl.object_no, &dl.object_offset, &olen); - if (r < 0) + if (r < 0) { + up_read(&osdc->map_sem); return -EIO; + } dl.file_offset -= dl.object_offset; dl.object_size = ceph_file_layout_object_size(ci->i_layout); dl.block_size = ceph_file_layout_su(ci->i_layout);