From nobody Thu Oct 07 15:40:54 2021 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 8375B17EE50A for ; Thu, 7 Oct 2021 15:41:04 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1p.ore.mailhop.org (outbound1p.ore.mailhop.org [54.149.210.130]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4HQFsX0tXLz3lTR for ; Thu, 7 Oct 2021 15:41:03 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1633621258; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=ZOBsm3yzKCmyJ32+K8yZEzt2z9mGRHbwaDrUZTdfIsqKILOQIzzN5UqaxqICjfsN4zqEfUtVXPtyL Zg34o0ktd5GL7w842PkvUb1s7UnvuBE33pzPy3aFVrV9/zdOh7jMaq/GMNtstNoXyLOTD2eTNakrtb NIaIC4fhchCCFLeAundb7PrhVix4nCLSCL69IoaTK7wrKqDR8ENJJJvvywiauUL6yZIGQ7zImiZDHh B6BsjUU4VwDMmJ10BXjzYdCi9Eola9KASyIHKfs7QgI02w53C3aX9+0S+yBwhYvOOgaylim9968gge je4jB+5UFxrmdc/hdlwo07SNLqQXfcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:dkim-signature:from; bh=NJt2dyOA9+7japku5TY5cm/4Y4vfx03cL0WGcU30v4E=; b=Sxm1U5EmxamUkNrjts4NyGtBX2ho+j6caw+cuPg4yU6IwMeOoeRSM/Fz2DBFUI+2S9UwLSLsOhW+y ya0xFSvFjFchtD4kMS+OkqSqZCM176I7Y+/GDQuO/53z3O1lRyt+uCwD4/1qmWIV/ty1VmjgM3an5x m6Lyl0WKGZ1FOl/Y3vQrQ3srriH50zgvcnz5Dswz2kpmgzKKsp/70blAmYavwnniaAvLwW1/5V1IBV gGvZE9xDPAJS+t5reppDrn11FhoKaLP2H+BkyeT74yC/uqVWhACsKXo4rfwBrqx4ZwuT4pC++gBZzw UR2kEmjnucxzeYEIagcEGVgxvyhStGQ== ARC-Authentication-Results: i=1; outbound3.ore.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=24.8.225.114; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:from; bh=NJt2dyOA9+7japku5TY5cm/4Y4vfx03cL0WGcU30v4E=; b=UeughENp/VEf8SaExB+SczFn6amc0VlO2VdFW/8sKdgTTU1zXFwdmBJ36VeKyAX9FsyzrD47RLqLl wlZ84nFluV1p9lupyfvyAhwjx/4f+IsckKb3X5Yyk/gD8rRUDH45ctQYNlqChsG+RCUMRuviVPBXrT M+XfF3WMDOq7tbOro3wlcLgQoT6IhT7x4cmFqpyFiD2Ns6taHe2HIUIPQ/mOtMslR2dJWWJVRqr/rw 5KVJciVQWc2phLtZjyazLP491XyhiODZYNNwHFzkxC1IrDJvwGrC4egr/RleMZU1h/RRiFWaAPiupT hLHjWgHFn0PAifWANh/SRZJG76i2/cQ== X-Originating-IP: 24.8.225.114 X-MHO-RoutePath: aGlwcGll X-MHO-User: f5957079-2784-11ec-9ab6-bf9d68d023b6 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (c-24-8-225-114.hsd1.co.comcast.net [24.8.225.114]) by outbound3.ore.mailhop.org (Halon) with ESMTPSA id f5957079-2784-11ec-9ab6-bf9d68d023b6; Thu, 07 Oct 2021 15:40:56 +0000 (UTC) Received: from [172.22.42.84] (rev2.hippie.lan [172.22.42.84]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id 197FesYs020432; Thu, 7 Oct 2021 09:40:54 -0600 (MDT) (envelope-from ian@freebsd.org) X-Authentication-Warning: paranoia.hippie.lan: Host rev2.hippie.lan [172.22.42.84] claimed to be [172.22.42.84] Message-ID: Subject: Re: git: 824bbb9a4082 - main - diff: consider two files with same inodes as identical From: Ian Lepore To: Alan Somers , Mariusz Zaborski Cc: src-committers , "" , dev-commits-src-main@freebsd.org Date: Thu, 07 Oct 2021 09:40:54 -0600 In-Reply-To: References: <202110071509.197F9kqv094488@gitrepo.freebsd.org> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.40.3 FreeBSD GNOME Team List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4HQFsX0tXLz3lTR X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N On Thu, 2021-10-07 at 09:32 -0600, Alan Somers wrote: > On Thu, Oct 7, 2021 at 9:09 AM Mariusz Zaborski > wrote: > > > > The branch main has been updated by oshogbo: > > > > URL: > > https://cgit.FreeBSD.org/src/commit/?id=824bbb9a40820fb62bde0a91c0f13e0b894da149 > > > > commit 824bbb9a40820fb62bde0a91c0f13e0b894da149 > > Author:     Mariusz Zaborski > > AuthorDate: 2021-10-07 15:07:00 +0000 > > Commit:     Mariusz Zaborski > > CommitDate: 2021-10-07 15:07:00 +0000 > > > >     diff: consider two files with same inodes as identical > > > >     Obtained from:  OpenBSD > >     MFC after:      1 week > > --- > >  usr.bin/diff/diffreg.c | 4 ++++ > >  1 file changed, 4 insertions(+) > > > > diff --git a/usr.bin/diff/diffreg.c b/usr.bin/diff/diffreg.c > > index fc3c3406a073..995843f9e539 100644 > > --- a/usr.bin/diff/diffreg.c > > +++ b/usr.bin/diff/diffreg.c > > @@ -440,6 +440,10 @@ files_differ(FILE *f1, FILE *f2, int flags) > >         if ((flags & (D_EMPTY1|D_EMPTY2)) || stb1.st_size != > > stb2.st_size || > >             (stb1.st_mode & S_IFMT) != (stb2.st_mode & S_IFMT)) > >                 return (1); > > + > > +       if (stb1.st_dev == stb2.st_dev && stb1.st_ino == > > stb2.st_ino) > > +               return (0); > > + > > Checking st_dev is not correct.  It does necessarily bear any > relation > to the specific mounted file system.  It might, but that's up to the > file system driver.  fusefs, for example, allows the server to > populate that field with whatever it damn well pleases.  diff should > use statfs instead, and check the f_fsid field.  That would probably > work. > -Alan That may be a fusefs bug, then. Posix states The st_ino and st_dev fields taken together uniquely identify the file within the system. And I've seen real-world code more than once that uses st_dev equality to decide whether to rename versus copy-and-delete a file. -- Ian