Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Sun, 11 Aug 2002 15:59:12 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Sun, 11 Aug 2002 15:59:12 -0400 Received: from pc2-cwma1-5-cust12.swa.cable.ntl.com ([80.5.121.12]:42484 "EHLO irongate.swansea.linux.org.uk") by vger.kernel.org with ESMTP id ; Sun, 11 Aug 2002 15:59:12 -0400 Subject: Re: [PATCH] Linux-2.5 fix/improve get_pid() From: Alan Cox To: Jamie Lokier Cc: Linus Torvalds , Paul Larson , Hubertus Franke , Rik van Riel , Andries Brouwer , Andrew Morton , andrea@suse.de, Dave Jones , lkml In-Reply-To: <20020811205847.A3206@kushida.apsleyroad.org> References: <20020810182317.A306@kushida.apsleyroad.org> <20020810194813.D306@kushida.apsleyroad.org> <1029098474.16236.58.camel@irongate.swansea.linux.org.uk> <20020811205847.A3206@kushida.apsleyroad.org> Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Mailer: Ximian Evolution 1.0.3 (1.0.3-6) Date: 11 Aug 2002 22:23:58 +0100 Message-Id: <1029101038.16424.74.camel@irongate.swansea.linux.org.uk> Mime-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 896 Lines: 19 On Sun, 2002-08-11 at 20:58, Jamie Lokier wrote: > Alan Cox wrote: > > If they hold both handles open and stat them and find the same inode > > number then yes its a bug. We have lots of room for inode numbers to > > handle 2^30 processes and allow for 2^30 other files > > So, in general, the way to detect hard links requires both objects to be > open at the same time? I was sure it was enough to stat(), and check > (st1.st_ino == st2.st_ino && st1.st_dev == st2.st_dev). > > Admittedly, one of the object could be renamed or deleted in that time > so it's not 100% reliable on changing filesystems. Hence you need both open at the same time. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/