From patchwork Thu Jun 5 17:04:39 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Trond Myklebust X-Patchwork-Id: 4307631 Return-Path: X-Original-To: patchwork-linux-nfs@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 E6D7B9F387 for ; Thu, 5 Jun 2014 17:09:57 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2D619201E4 for ; Thu, 5 Jun 2014 17:09:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 43A1D2034F for ; Thu, 5 Jun 2014 17:09:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751799AbaFEREp (ORCPT ); Thu, 5 Jun 2014 13:04:45 -0400 Received: from mail-ie0-f170.google.com ([209.85.223.170]:60117 "EHLO mail-ie0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751915AbaFEREn (ORCPT ); Thu, 5 Jun 2014 13:04:43 -0400 Received: by mail-ie0-f170.google.com with SMTP id to1so1168766ieb.15 for ; Thu, 05 Jun 2014 10:04:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id; bh=5OroI6mtvj7xM0FxivSb22kLtT6Vq533mrxk02YOqVo=; b=OdTZN0mgYjiYOAFt2lThhIvUAypI1k0PVbK4AN7CnaHQoZd6MUC3Z+/Nrn2xcSuBZo eJiz2rjwqyR70knauOHUd9Fa2SMX5k1VXyDz8LDe3037llqsIEW+dPAmJftdPp9hPf8Y td2cLncypRXfMF9HLgtGNHG8JnaXTnLn9YBdKHtcQxPFrRu5M37MP6MncEHPuFYpF1/t 2kcXFfM78SBdu6YvnVcg/2ng5lSKGkUw80fpw3kO87hZitk50O99CX8H3ERab/Tm76uL n4x8cNwQ1J6hrGuVA9hwOYe+7+G7ZYLgS4n/jK8gO1cI1F+uwdZklo4YBesMy7A2xCko /3mA== X-Gm-Message-State: ALoCoQnPZgP1UiQPflK/aL6hquCLeiC7IZLXfTTSS85hMsiKJQoJdM4QdhPypwA5tc2CosePkmOH X-Received: by 10.50.128.162 with SMTP id np2mr22494348igb.22.1401987881818; Thu, 05 Jun 2014 10:04:41 -0700 (PDT) Received: from leira.trondhjem.org.localdomain (c-98-209-19-95.hsd1.mi.comcast.net. [98.209.19.95]) by mx.google.com with ESMTPSA id mj5sm19805202igb.6.2014.06.05.10.04.40 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 Jun 2014 10:04:41 -0700 (PDT) From: Trond Myklebust To: linux-nfs@vger.kernel.org Subject: [PATCH] NFS: Use raw_write_seqcount_begin/end int nfs4_reclaim_open_state Date: Thu, 5 Jun 2014 13:04:39 -0400 Message-Id: <1401987879-2927-1-git-send-email-trond.myklebust@primarydata.com> X-Mailer: git-send-email 1.9.3 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, 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 The addition of lockdep code to write_seqcount_begin/end has lead to a bunch of false positive claims of ABBA deadlocks with the so_lock spinlock. Audits show that this simply cannot happen because the read side code does not spin while holding so_lock. Cc: # 3.13.x Signed-off-by: Trond Myklebust --- fs/nfs/nfs4state.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c index 2349518eef2c..21275148fc13 100644 --- a/fs/nfs/nfs4state.c +++ b/fs/nfs/nfs4state.c @@ -1456,7 +1456,7 @@ static int nfs4_reclaim_open_state(struct nfs4_state_owner *sp, const struct nfs * server that doesn't support a grace period. */ spin_lock(&sp->so_lock); - write_seqcount_begin(&sp->so_reclaim_seqcount); + raw_write_seqcount_begin(&sp->so_reclaim_seqcount); restart: list_for_each_entry(state, &sp->so_states, open_states) { if (!test_and_clear_bit(ops->state_flag_bit, &state->flags)) @@ -1519,13 +1519,13 @@ restart: spin_lock(&sp->so_lock); goto restart; } - write_seqcount_end(&sp->so_reclaim_seqcount); + raw_write_seqcount_end(&sp->so_reclaim_seqcount); spin_unlock(&sp->so_lock); return 0; out_err: nfs4_put_open_state(state); spin_lock(&sp->so_lock); - write_seqcount_end(&sp->so_reclaim_seqcount); + raw_write_seqcount_end(&sp->so_reclaim_seqcount); spin_unlock(&sp->so_lock); return status; }