From patchwork Mon Jan 21 14:54:28 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benny Halevy X-Patchwork-Id: 2012831 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 77C403FDD2 for ; Mon, 21 Jan 2013 14:54:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753201Ab3AUOyc (ORCPT ); Mon, 21 Jan 2013 09:54:32 -0500 Received: from mail-ee0-f46.google.com ([74.125.83.46]:42426 "EHLO mail-ee0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752612Ab3AUOyc (ORCPT ); Mon, 21 Jan 2013 09:54:32 -0500 Received: by mail-ee0-f46.google.com with SMTP id e49so2982560eek.33 for ; Mon, 21 Jan 2013 06:54:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references; bh=82qFs4vs599IbUgOwRm62DpLLMSyvYA3gvFwqQwaOCs=; b=WEh1NiOiYlw1b2QGaOVY1IaxzibE2rMxIYJUTd+6VgvjGW/d6qCFs4X9Gf4DQ5I4FN pznM5MSsjVfHgSxIedTyAB69VJrP6/zDrpFyPziZS4WxuQhqQ4+bV1gR5OOD2uJrMV/b U4K4bHxz+C2VMEJ3C13BDThz4JQqerguzkZJ8azT+Xz0ZTAw0Je4IBCjxxuhTxt7gkIo OkgDN0TXjNtRk22tYH2fWnxiT1Q1x5rSbjwI3YeTu9MCfVaeap2aok8GJBZmlm6rz92P 2gcILULsbCgNjGcwffNslnTCIqeE03rs8hDBRAKvJ4ZzamARyTCVFRbYIJNuIHewTxer Flcg== X-Received: by 10.14.207.195 with SMTP id n43mr60735210eeo.38.1358780070657; Mon, 21 Jan 2013 06:54:30 -0800 (PST) Received: from bhalevy-lt.il.tonian.com ([46.120.7.251]) by mx.google.com with ESMTPS id q44sm22608614eep.5.2013.01.21.06.54.29 (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 21 Jan 2013 06:54:30 -0800 (PST) From: Benny Halevy To: linux-nfs@vger.kernel.org Cc: Benny Halevy Subject: [PATCH 3/9] SQUASHME: pnfsd: do not dequeue layout state on destroy_layout Date: Mon, 21 Jan 2013 16:54:28 +0200 Message-Id: <1358780068-5983-1-git-send-email-bhalevy@tonian.com> X-Mailer: git-send-email 1.7.11.7 In-Reply-To: <50FD5646.4020206@tonian.com> References: <50FD5646.4020206@tonian.com> Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org the layout state may be shared by a number of layout segments, each held by struct nfs4_layout and we may be destroying just one of them e.g. on layoutreturn. Signed-off-by: Benny Halevy --- fs/nfsd/nfs4pnfsd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/nfsd/nfs4pnfsd.c b/fs/nfsd/nfs4pnfsd.c index fe3f693..c62af3d 100644 --- a/fs/nfsd/nfs4pnfsd.c +++ b/fs/nfsd/nfs4pnfsd.c @@ -345,7 +345,6 @@ static void update_layout_roc(struct nfs4_layout_state *ls, bool roc) __func__, lp, clp, fp, fp->fi_inode); kmem_cache_free(pnfs_layout_slab, lp); - list_del_init(&ls->ls_perfile); /* release references taken by init_layout */ put_layout_state(ls); put_nfs4_file(fp); @@ -1249,6 +1248,7 @@ void pnfsd_roc(struct nfs4_client *clp, struct nfs4_file *fp) memset(&lr, 0, sizeof(lr)); lr.args.lr_return_type = RETURN_FILE; lr.args.lr_seg = lo->lo_seg; + list_del_init(&lo->lo_state->ls_perfile); /* just to be on the safe side */ dequeue_layout(lo); destroy_layout(lo); /* do not access lp after this */ @@ -1301,6 +1301,7 @@ void pnfs_expire_client(struct nfs4_client *clp) lr.args.lr_seg = lp->lo_seg; empty = list_empty(&lp->lo_file->fi_layouts); BUG_ON(lp->lo_client != clp); + list_del_init(&lp->lo_state->ls_perfile); /* just to be on the safe side */ dequeue_layout(lp); destroy_layout(lp); /* do not access lp after this */ }