From patchwork Wed Jul 23 17:46:49 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 4612331 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 4EB3A9F295 for ; Wed, 23 Jul 2014 17:47:00 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7B7002017D for ; Wed, 23 Jul 2014 17:46:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6BCD620154 for ; Wed, 23 Jul 2014 17:46:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932562AbaGWRq5 (ORCPT ); Wed, 23 Jul 2014 13:46:57 -0400 Received: from mail-qg0-f49.google.com ([209.85.192.49]:65356 "EHLO mail-qg0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932485AbaGWRq4 (ORCPT ); Wed, 23 Jul 2014 13:46:56 -0400 Received: by mail-qg0-f49.google.com with SMTP id j107so1834014qga.8 for ; Wed, 23 Jul 2014 10:46:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=AXlkjEaS6TOJfUAk310XkF/tpAIX/U5G/qY4iQhEle0=; b=edb/qUROfmjoKMbnPwhdMF44NS8WW4JnMec+xcC7IdiRkE1COhQ1ylhX+xQeQeottI vMouFBdlsUYpJmz9q5U90wYbnTPm0QhBK0Zrg1oomswRBMOVUE7tJbmaQnBwyqE9LvX2 y8eTF5sXNEUw2mcjFrrdDMDnjSwLwfrYUrGlUh/MKUDzAdqefPYqO8y6NIsLMGl+d8G7 uAqZ0mVnooj3TQ7gKYtA7qow/zK4fqCyLyeEmWV8WvXHD4u5kDOsKp9n/21BMWo38ymI Z7rI8AUVLGUL9vK1pCgJw4lnZTHtrDUFDeHVqelunaXzD0Zr7SXqyUB9sGm3EpMLCwhA +TuA== X-Gm-Message-State: ALoCoQnwzvQdiM15M5wvBqSRUTwxHTkjnO0iKzzZAKVH2Q1JBLja7A2N3zBSNYPhroyeE3YrzpqR X-Received: by 10.224.112.1 with SMTP id u1mr4521170qap.7.1406137615810; Wed, 23 Jul 2014 10:46:55 -0700 (PDT) Received: from tlielax.poochiereds.net ([2001:470:8:d63:3a60:77ff:fe93:a95d]) by mx.google.com with ESMTPSA id ik1sm5051238qab.32.2014.07.23.10.46.53 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Jul 2014 10:46:54 -0700 (PDT) From: Jeff Layton To: bfields@fieldses.org Cc: linux-nfs@vger.kernel.org, hch@infradead.org Subject: [PATCH] nfsd: ensure that st_access_bmap and st_deny_bmap are initialized to 0 Date: Wed, 23 Jul 2014 13:46:49 -0400 Message-Id: <1406137609-24466-1-git-send-email-jlayton@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=-6.9 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 Open stateids must be initialized with the st_access_bmap and st_deny_bmap set to 0, so that nfs4_get_vfs_file can properly record their state in old_access_bmap and old_deny_bmap. This bug was introduced in commit baeb4ff0e502 (nfsd: make deny mode enforcement more efficient and close races in it) and was causing the refcounts to end up incorrect when nfs4_get_vfs_file returned an error after bumping the refcounts. This made it impossible to unmount the underlying filesystem after running pynfs tests that involve deny modes. Signed-off-by: Jeff Layton --- fs/nfsd/nfs4state.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index 72da0d44e66b..ce07e9517a80 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -2968,8 +2968,6 @@ static void init_open_stateid(struct nfs4_ol_stateid *stp, struct nfs4_file *fp, stp->st_file = fp; stp->st_access_bmap = 0; stp->st_deny_bmap = 0; - set_access(open->op_share_access, stp); - set_deny(open->op_share_deny, stp); stp->st_openstp = NULL; spin_lock(&fp->fi_lock); list_add(&stp->st_perfile, &fp->fi_stateids);