From nobody Thu Oct 7 15:32:17 2021 X-Original-To: dev-commits-src-main@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 AEBE117ED416; Thu, 7 Oct 2021 15:32:35 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-oi1-f179.google.com (mail-oi1-f179.google.com [209.85.167.179]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HQFgl3hgKz3kSW; Thu, 7 Oct 2021 15:32:35 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-oi1-f179.google.com with SMTP id o83so2062637oif.4; Thu, 07 Oct 2021 08:32:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=sL44217jecSciZiR7knXfRVhcyqeiQP3uqs9f6wdvyE=; b=b/Iwl7Q/cmpDktEjujZZuQpiRv/zHnAs8FW/2EHa6/iLnWnv9hUmkxt/RFIddJUXwg 5WP1OuUJ8MP/fZm25nwOmGfzZ6mu55skErU0aqMBgcE/WF4LVDcivFMElVTIgMO/otmV XDoeFIPXPSnMP+EyxBHbBVT7Zz03H+F95KQPhLIyhwQXNG+xTP9kWsYE3iH9NwBMFkgj tUutLC3lS1f8k8+u8At50wAIJaxXJp6u+SLfHjdXY7HgKcXFag2lNe5zQTykGWsXWm7O pIxBgReLNWaBszbcETME2NAJd3jSh1VVCGmXYmmyThDeJYqoIbw/BjliHpTGlwON0l7k kQQg== X-Gm-Message-State: AOAM530nDfawIBOlDzh/siSTuSMQMDhkH1yeM8WOsGDBRZ+TyElt5Xol PiDoTcXjgoKd+80xUFRRmFo1OgAhwPNh2YnOO5yC6U7t X-Google-Smtp-Source: ABdhPJwbin7rMWbpSTf1O+tKnrFPyDsslKSvbqlmSINtSZVXiFPCcUM0biVoy4JbmB5aexcyaDbRj4zFlm3bsh24kx8= X-Received: by 2002:aca:1b09:: with SMTP id b9mr12341542oib.55.1633620748510; Thu, 07 Oct 2021 08:32:28 -0700 (PDT) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 References: <202110071509.197F9kqv094488@gitrepo.freebsd.org> In-Reply-To: <202110071509.197F9kqv094488@gitrepo.freebsd.org> From: Alan Somers Date: Thu, 7 Oct 2021 09:32:17 -0600 Message-ID: Subject: Re: git: 824bbb9a4082 - main - diff: consider two files with same inodes as identical To: Mariusz Zaborski Cc: src-committers , "" , dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4HQFgl3hgKz3kSW 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, 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