From patchwork Mon Oct 13 14:08:15 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Adamson X-Patchwork-Id: 5076761 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 1379BC11AC for ; Mon, 13 Oct 2014 14:08:27 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4BE2A2020F for ; Mon, 13 Oct 2014 14:08:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 232AA20204 for ; Mon, 13 Oct 2014 14:08:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752382AbaJMOIX (ORCPT ); Mon, 13 Oct 2014 10:08:23 -0400 Received: from mx12.netapp.com ([216.240.18.77]:59242 "EHLO mx12.netapp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752174AbaJMOIX (ORCPT ); Mon, 13 Oct 2014 10:08:23 -0400 X-IronPort-AV: E=Sophos;i="5.04,711,1406617200"; d="scan'208";a="202999268" Received: from vmwexchts02-prd.hq.netapp.com ([10.122.105.23]) by mx12-out.netapp.com with ESMTP; 13 Oct 2014 07:08:19 -0700 Received: from ngzemlsmt03-prd.corp.netapp.com (10.122.76.115) by VMWEXCHTS02-PRD.hq.netapp.com (10.122.105.23) with Microsoft SMTP Server (TLS) id 15.0.995.29; Mon, 13 Oct 2014 07:08:17 -0700 Received: from netapp-51.nfsv4bat.org.localdomain (vpn2ntap-261843.vpn.netapp.com [10.55.65.14]) by ngzemlsmt03-prd.corp.netapp.com (8.14.4+Sun/8.14.4/NTAP-1.6) with ESMTP id s9DE8IYf007762; Mon, 13 Oct 2014 07:08:18 -0700 (PDT) From: To: CC: , Andy Adamson Subject: [PATCH 1/1] NFSv4: open context can be NULL in nfs_put_open_context Date: Mon, 13 Oct 2014 10:08:15 -0400 Message-ID: <1413209295-13509-1-git-send-email-andros@netapp.com> X-Mailer: git-send-email 1.8.3.1 MIME-Version: 1.0 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, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 From: Andy Adamson If a pgio error is caught before the nfs_pgio_header args->context is set with get_nfs_open_context, the context can be NULL. Signed-off-by: Andy Adamson --- fs/nfs/inode.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c index 141c9f4..a2b148e 100644 --- a/fs/nfs/inode.c +++ b/fs/nfs/inode.c @@ -798,6 +798,9 @@ static void __put_nfs_open_context(struct nfs_open_context *ctx, int is_sync) struct inode *inode = ctx->dentry->d_inode; struct super_block *sb = ctx->dentry->d_sb; + if (ctx == NULL) + return; + if (!list_empty(&ctx->list)) { if (!atomic_dec_and_lock(&ctx->lock_context.count, &inode->i_lock)) return;