From mboxrd@z Thu Jan 1 00:00:00 1970 From: Cyrill Gorcunov Subject: Re: [PATCH] proc: show locks in /proc/pid/fdinfo/X Date: Fri, 6 Mar 2015 11:38:05 +0300 Message-ID: <20150306083805.GD2263@moon> References: <1425569838-20416-1-git-send-email-avagin@openvz.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-doc@vger.kernel.org, Jonathan Corbet , Alexander Viro , Jeff Layton , "J. Bruce Fields" , Andrew Morton , Pavel Emelyanov To: Andrey Vagin Return-path: Received: from mail-la0-f54.google.com ([209.85.215.54]:40905 "EHLO mail-la0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932258AbbCFIiK (ORCPT ); Fri, 6 Mar 2015 03:38:10 -0500 Content-Disposition: inline In-Reply-To: <1425569838-20416-1-git-send-email-avagin@openvz.org> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Thu, Mar 05, 2015 at 06:37:18PM +0300, Andrey Vagin wrote: > Let's show locks which are associated with a file descriptor in > its fdinfo file. > > Currently we don't have a reliable way to determine who holds a lock. > We can find some information in /proc/locks, but PID which is reported > there can be wrong. For example, a process takes a lock, then forks a > child and dies. In this case /proc/locks contains the parent pid, which > can be reused by another process. > > $ cat /proc/locks > ... > 6: FLOCK ADVISORY WRITE 324 00:13:13431 0 EOF > ... > > $ ps -C rpcbind > PID TTY TIME CMD > 332 ? 00:00:00 rpcbind > ... Looks reasonable to me, thanks! Acked-by: Cyrill Gorcunov