From mboxrd@z Thu Jan 1 00:00:00 1970 From: Al Viro Subject: Re: Getting PIDs out of inodes? Date: Thu, 16 Jan 2014 04:44:15 +0000 Message-ID: <20140116044414.GV10323@ZenIV.linux.org.uk> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-fsdevel@vger.kernel.org To: Ismael Farf??n Return-path: Received: from zeniv.linux.org.uk ([195.92.253.2]:47691 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750900AbaAPEoQ (ORCPT ); Wed, 15 Jan 2014 23:44:16 -0500 Content-Disposition: inline In-Reply-To: Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Wed, Jan 15, 2014 at 04:08:01PM -0600, Ismael Farf??n wrote: > Hello list. > > I'm struggling with a problem involving some orphan descriptors I > found in a crash dump. > > I'd like to know who created or inherited (as in fork) them. I mustn't > talk ill of the dead, but they are my prime suspects because of this > (doesn't shows with ps): > [49886.362859] umount.nfs[8425]: segfault at 19... bla bla > > Given what I read[1,2], there doesn't seem to be a direct way to get > the struct file (which contains a PID) out of the inode. That makes no sense. struct file does *not* contain a PID. > I don't know if it's possible to script an iteration with crash over > all tasks in search of a particular inode. > DENTRY INODE TYPE PATH > ffff880936419900 ffff8808d17c5518 REG foo.txt > > Any ideas on how to know who created the file descriptors? ... and descriptor != struct file. Moreover, if "who?" is "which process?", it might have been dead, buried and its PID reused a long time ago - opened file can easily outlive the process that had opened it. What are you actually trying to do? Details, please...