From patchwork Tue Feb 22 17:47:29 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benny Halevy X-Patchwork-Id: 580821 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p1MHlZtN017417 for ; Tue, 22 Feb 2011 17:47:35 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752543Ab1BVRrd (ORCPT ); Tue, 22 Feb 2011 12:47:33 -0500 Received: from daytona.panasas.com ([67.152.220.89]:13736 "EHLO daytona.panasas.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750784Ab1BVRrd (ORCPT ); Tue, 22 Feb 2011 12:47:33 -0500 Received: from lt.bhalevy.com.com ([172.17.142.139]) by daytona.panasas.com with Microsoft SMTPSVC(6.0.3790.4675); Tue, 22 Feb 2011 12:47:32 -0500 From: Benny Halevy To: linux-nfs@vger.kernel.org Cc: Benny Halevy Subject: [PATCH] SQUASHME: pnfs: fix lock inversion in pnfs_layout_process Date: Tue, 22 Feb 2011 09:47:29 -0800 Message-Id: <1298396849-19340-1-git-send-email-bhalevy@panasas.com> X-Mailer: git-send-email 1.7.3.4 X-OriginalArrivalTime: 22 Feb 2011 17:47:32.0524 (UTC) FILETIME=[94F746C0:01CBD2B8] Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Tue, 22 Feb 2011 17:47:35 +0000 (UTC) diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c index 5a47b76..c184e41 100644 --- a/fs/nfs/pnfs.c +++ b/fs/nfs/pnfs.c @@ -1045,7 +1045,6 @@ pnfs_layout_process(struct nfs4_layoutget *lgp) goto out; } - spin_lock(&ino->i_lock); /* decrement needs to be done before call to pnfs_layoutget_blocked */ atomic_dec(&lo->plh_outstanding); spin_lock(&clp->cl_lock); @@ -1056,6 +1055,7 @@ pnfs_layout_process(struct nfs4_layoutget *lgp) } spin_unlock(&clp->cl_lock); + spin_lock(&ino->i_lock); if (pnfs_layoutgets_blocked(lo, &res->stateid)) { dprintk("%s forget reply due to state\n", __func__); goto out_forget_reply;