From patchwork Wed Jul 27 18:40:48 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Rees X-Patchwork-Id: 1012702 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p6RIesIa009268 for ; Wed, 27 Jul 2011 18:41:34 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754845Ab1G0Sld (ORCPT ); Wed, 27 Jul 2011 14:41:33 -0400 Received: from merit-proxy01.merit.edu ([207.75.116.193]:34838 "EHLO merit-proxy01.merit.edu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754558Ab1G0Sld (ORCPT ); Wed, 27 Jul 2011 14:41:33 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by merit-proxy01.merit.edu (Postfix) with ESMTP id 139542039B07; Wed, 27 Jul 2011 14:41:33 -0400 (EDT) X-Virus-Scanned: amavisd-new at merit-proxy01.merit.edu Received: from merit-proxy01.merit.edu ([127.0.0.1]) by localhost (merit-proxy01.merit.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id s0lcTBa3klBJ; Wed, 27 Jul 2011 14:41:32 -0400 (EDT) Received: from merit.edu (dhcp-12be.meeting.ietf.org [130.129.18.190]) by merit-proxy01.merit.edu (Postfix) with ESMTPSA id 99A822039AE8; Wed, 27 Jul 2011 14:41:32 -0400 (EDT) From: Jim Rees To: Trond Myklebust Cc: linux-nfs@vger.kernel.org, peter honeyman Subject: [PATCH v3 25/25] NFS41: Drop lseg ref before fallthru to MDS Date: Wed, 27 Jul 2011 14:40:48 -0400 Message-Id: <1311792048-12551-26-git-send-email-rees@umich.edu> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1311792048-12551-1-git-send-email-rees@umich.edu> References: <1311792048-12551-1-git-send-email-rees@umich.edu> 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]); Wed, 27 Jul 2011 18:41:34 +0000 (UTC) From: Peng Tao There is no need to keep lseg reference when read/write through MDS. This fixes a null pointer crash at nfs_post_op_update_inode_force_wcc because nfs4_proc_write_setup will unset wdata->res.fattr if wdata->lseg is not NULL. Signed-off-by: Peng Tao --- fs/nfs/pnfs.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c index 3b20753..fda3019 100644 --- a/fs/nfs/pnfs.c +++ b/fs/nfs/pnfs.c @@ -1182,6 +1182,9 @@ pnfs_ld_write_done(struct nfs_write_data *data) dprintk("%s: pnfs_error=%d, retry via MDS\n", __func__, data->pnfs_error); + + put_lseg(data->lseg); + data->lseg = NULL; status = nfs_initiate_write(data, NFS_CLIENT(data->inode), data->mds_ops, NFS_FILE_SYNC); return status ? : -EAGAIN; @@ -1282,6 +1285,9 @@ pnfs_ld_read_done(struct nfs_read_data *data) dprintk("%s: pnfs_error=%d, retry via MDS\n", __func__, data->pnfs_error); + + put_lseg(data->lseg); + data->lseg = NULL; status = nfs_initiate_read(data, NFS_CLIENT(data->inode), data->mds_ops); return status ? : -EAGAIN;