From patchwork Tue Jan 15 03:07:41 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ycnian@gmail.com X-Patchwork-Id: 1974441 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 1B6FB3FE33 for ; Tue, 15 Jan 2013 03:17:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755388Ab3AODR1 (ORCPT ); Mon, 14 Jan 2013 22:17:27 -0500 Received: from mail-pa0-f43.google.com ([209.85.220.43]:57966 "EHLO mail-pa0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754869Ab3AODR0 (ORCPT ); Mon, 14 Jan 2013 22:17:26 -0500 Received: by mail-pa0-f43.google.com with SMTP id fb10so2646935pad.16 for ; Mon, 14 Jan 2013 19:17:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer; bh=iqU5/6v3zgOoGutKIqdVNaaOKVxlKWj1dbKoNMuWRTE=; b=xzPGTNmd8jNabGbKUXbNLyhHjGmTu+SWaz4NZvxg3je22mFDR0Hv9mk7vlxnpvRi5O ut+WklGhquSkGln/DYbe5xki/Sev3ycOvQhyrVLjt12zdt+9pr6V+VWXOCPm4X2un/nc CH0OJiZ5OuO0eCMgc/JdYQxdGngBz2cD/3J87nXPKgJjX9eKUMnz4xRqldb8XJq/wh+I 2SjuT5HS9yWwKTFVhJuh1KlBecvoWUyZ1ULbVtBdlyRv5yeQWneqryzNMLQHiXQGXvtX hswco8sBRbY1Zzgy/roGTQD0A3WkMoMVGct8Dp/6AqlpLFijgg0SWCO+PDvsK8FWcEak uyXA== X-Received: by 10.68.189.65 with SMTP id gg1mr257695340pbc.57.1358219846299; Mon, 14 Jan 2013 19:17:26 -0800 (PST) Received: from localhost ([159.226.5.131]) by mx.google.com with ESMTPS id qh4sm9318590pbb.9.2013.01.14.19.17.24 (version=TLSv1.1 cipher=RC4-SHA bits=128/128); Mon, 14 Jan 2013 19:17:25 -0800 (PST) From: ycnian@gmail.com To: bhalevy@tonian.com Cc: linux-nfs@vger.kernel.org, Yanchuan Nian Subject: [PATCH] pnfsd: Fix unlock bug on error path Date: Tue, 15 Jan 2013 11:07:41 +0800 Message-Id: <1358219261-19974-1-git-send-email-ycnian@gmail.com> X-Mailer: git-send-email 1.7.4.4 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org From: Yanchuan Nian LAYOUTGET procedure fails if the layout requested conflicts with the recalled. It needs to put the reference and unlock the state before exiting. Signed-off-by: Yanchuan Nian --- fs/nfsd/nfs4pnfsd.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/fs/nfsd/nfs4pnfsd.c b/fs/nfsd/nfs4pnfsd.c index dd7856c..4a1e17b 100644 --- a/fs/nfsd/nfs4pnfsd.c +++ b/fs/nfsd/nfs4pnfsd.c @@ -760,7 +760,7 @@ nfs4_pnfs_get_layout(struct nfsd4_pnfs_layoutget *lgp, if (is_layout_recalled(clp, lgp->lg_fhp, &lgp->lg_seg)) { nfserr = nfserr_recallconflict; - goto out; + goto out_unlock; } /* pre-alloc layout in case we can't merge after we call