From owner-freebsd-stable@FreeBSD.ORG Fri Jun 7 09:07:35 2013 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id BAE7D3CF; Fri, 7 Jun 2013 09:07:35 +0000 (UTC) (envelope-from jsteckli@os.inf.tu-dresden.de) Received: from os.inf.tu-dresden.de (os.inf.tu-dresden.de [IPv6:2002:8d4c:3001:48::99]) by mx1.freebsd.org (Postfix) with ESMTP id 81B991242; Fri, 7 Jun 2013 09:07:35 +0000 (UTC) Received: from [2002:8d4c:3001:48:ea40:f2ff:fee2:6328] by os.inf.tu-dresden.de with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.80.1) id 1Uksdy-0001nT-IZ; Fri, 07 Jun 2013 11:07:34 +0200 Message-ID: <51B1A2D6.4030901@os.inf.tu-dresden.de> Date: Fri, 07 Jun 2013 11:07:34 +0200 From: Julian Stecklina User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130514 Thunderbird/17.0.6 MIME-Version: 1.0 To: John Baldwin , freebsd-stable@freebsd.org Subject: Re: Reproducable Infiniband panic References: <51B07705.207@os.inf.tu-dresden.de> <51B0949B.1050606@FreeBSD.org> <201306061457.52278.jhb@freebsd.org> In-Reply-To: <201306061457.52278.jhb@freebsd.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Jun 2013 09:07:35 -0000 On 06/06/2013 08:57 PM, John Baldwin wrote: > On Thursday, June 06, 2013 9:54:35 am Andriy Gapon wrote: [...] >> The problem seems to be in incorrect interaction between devfs_close_f and >> linux_file_dtor. The latter expects curthread->td_fpop to have a valid reasonable >> value. But the former sets curthread->td_fpop to fp only around vnops.fo_close() >> call and then restores it back to some (what?) previous value before calling >> devfs_fpdrop->devfs_destroy_cdevpriv. In this case the previous value is NULL. > > It is normally NULL in this case. Why does linux_file_dtor even look at > td_fpop? > > Ah. I think it should not do that and make the data it uses in the dtor more > self-contained: > > Index: sys/ofed/include/linux/linux_compat.c > =================================================================== > --- linux_compat.c (revision 251465) > +++ linux_compat.c (working copy) > @@ -212,7 +212,7 @@ linux_file_dtor(void *cdp) > struct linux_file *filp; > > filp = cdp; > - filp->f_op->release(curthread->td_fpop->f_vnode, filp); > + filp->f_op->release(filp->f_vnode, filp); > kfree(filp); > } > > @@ -232,6 +232,7 @@ linux_dev_open(struct cdev *dev, int oflags, int d > filp->f_dentry = &filp->f_dentry_store; > filp->f_op = ldev->ops; > filp->f_flags = file->f_flag; > + filp->f_vnode = file->f_vnode; > if (filp->f_op->open) { > error = -filp->f_op->open(file->f_vnode, filp); > if (error) { > Doesn't compile for me. Did you forget to add the f_vnode member to struct linux_file? sys/ofed/include/linux/linux_compat.c: In function 'linux_file_dtor': sys/ofed/include/linux/linux_compat.c:214: error: 'struct linux_file' has no member named 'f_vnode' sys/ofed/include/linux/linux_compat.c: In function 'linux_dev_open': sys/ofed/include/linux/linux_compat.c:234: error: 'struct linux_file' has no member named 'f_vnode' Julian