From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Aneesh Kumar K. V" Subject: Re: [PATCH] [fs/9p] Check for NULL fid in v9fs_dir_release() Date: Thu, 26 Aug 2010 11:51:48 +0530 Message-ID: References: <1282753581-28231-1-git-send-email-jvrao@linux.vnet.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-fsdevel@vger.kernel.org, "Venkateswararao Jujjuri \(JV\)" To: "Venkateswararao Jujjuri \(JV\)" , v9fs-developer@lists.sourceforge.net Return-path: Received: from e28smtp09.in.ibm.com ([122.248.162.9]:39124 "EHLO e28smtp09.in.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751859Ab0HZGVw (ORCPT ); Thu, 26 Aug 2010 02:21:52 -0400 Received: from d28relay01.in.ibm.com (d28relay01.in.ibm.com [9.184.220.58]) by e28smtp09.in.ibm.com (8.14.4/8.13.1) with ESMTP id o7Q68cGd010549 for ; Thu, 26 Aug 2010 11:38:38 +0530 Received: from d28av04.in.ibm.com (d28av04.in.ibm.com [9.184.220.66]) by d28relay01.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id o7Q6Lnip1450056 for ; Thu, 26 Aug 2010 11:51:49 +0530 Received: from d28av04.in.ibm.com (loopback [127.0.0.1]) by d28av04.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id o7Q6LmcG011630 for ; Thu, 26 Aug 2010 16:21:49 +1000 In-Reply-To: <1282753581-28231-1-git-send-email-jvrao@linux.vnet.ibm.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Wed, 25 Aug 2010 09:26:21 -0700, "Venkateswararao Jujjuri (JV)" wrote: > NULL fid should be handled in cases where we endup calling v9fs_dir_release() > before even we instantiate the fid in filp. > > Signed-off-by: Venkateswararao Jujjuri > --- > fs/9p/vfs_dir.c | 6 ++++-- > 1 files changed, 4 insertions(+), 2 deletions(-) > > diff --git a/fs/9p/vfs_dir.c b/fs/9p/vfs_dir.c > index 16c8a2a..899f168 100644 > --- a/fs/9p/vfs_dir.c > +++ b/fs/9p/vfs_dir.c > @@ -292,9 +292,11 @@ int v9fs_dir_release(struct inode *inode, struct file *filp) > > fid = filp->private_data; > P9_DPRINTK(P9_DEBUG_VFS, > - "inode: %p filp: %p fid: %d\n", inode, filp, fid->fid); > + "v9fs_dir_release: inode: %p filp: %p fid: %d\n", > + inode, filp, fid ? fid->fid : -1); > filemap_write_and_wait(inode->i_mapping); > - p9_client_clunk(fid); > + if (fid) > + p9_client_clunk(fid); > return 0; > } > Can you get a stack trace where we end up calling dir_release with null fid -aneesh