From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Venkateswararao Jujjuri (JV)" Subject: Re: [PATCH] [net/9p] Add a Warning to catch NULL fids passed to p9_client_clunk(). Date: Thu, 26 Aug 2010 08:16:52 -0700 Message-ID: <4C768564.9070707@linux.vnet.ibm.com> References: <1282753626-28268-1-git-send-email-jvrao@linux.vnet.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: v9fs-developer@lists.sourceforge.net, linux-fsdevel@vger.kernel.org To: "Aneesh Kumar K. V" Return-path: Received: from e2.ny.us.ibm.com ([32.97.182.142]:35858 "EHLO e2.ny.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753974Ab0HZPQ4 (ORCPT ); Thu, 26 Aug 2010 11:16:56 -0400 Received: from d01relay04.pok.ibm.com (d01relay04.pok.ibm.com [9.56.227.236]) by e2.ny.us.ibm.com (8.14.4/8.13.1) with ESMTP id o7QF2ZL1007108 for ; Thu, 26 Aug 2010 11:02:36 -0400 Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by d01relay04.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id o7QFGtgT081926 for ; Thu, 26 Aug 2010 11:16:55 -0400 Received: from d03av02.boulder.ibm.com (loopback [127.0.0.1]) by d03av02.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id o7QFGsAY020586 for ; Thu, 26 Aug 2010 09:16:55 -0600 In-Reply-To: Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Aneesh Kumar K. V wrote: > On Wed, 25 Aug 2010 09:27:06 -0700, "Venkateswararao Jujjuri (JV)" wrote: >> Signed-off-by: Venkateswararao Jujjuri >> --- >> net/9p/client.c | 6 ++++++ >> 1 files changed, 6 insertions(+), 0 deletions(-) >> >> diff --git a/net/9p/client.c b/net/9p/client.c >> index dc6f2f2..aa7be29 100644 >> --- a/net/9p/client.c >> +++ b/net/9p/client.c >> @@ -1201,6 +1201,12 @@ int p9_client_clunk(struct p9_fid *fid) >> struct p9_client *clnt; >> struct p9_req_t *req; >> >> + if (!fid) { >> + P9_EPRINTK(KERN_WARNING, "Trying to clunk with NULL fid\n"); >> + dump_stack(); >> + return 0; >> + } >> + >> P9_DPRINTK(P9_DEBUG_9P, ">>> TCLUNK fid %d\n", fid->fid); >> err = 0; >> clnt = fid->clnt; > > But why ? We should not have called clunk on null fid. Do you see any > area of code that can do this ? Or is it a debug patch that you did when > developing other features. In case of later do we need to merge this > upstream ? It is kind of debug patch..as we don't know any known case, assuming that the v9fs_dir_release() goes into mainline. It will be nice if merged into upstream..but not an absolute requirement. Thanks, JV > > -aneesh