Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id ADD38C433E0 for ; Thu, 25 Jun 2020 14:19:27 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 866AD20775 for ; Thu, 25 Jun 2020 14:19:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 866AD20775 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=citrix.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1joSih-000810-Ty; Thu, 25 Jun 2020 14:19:15 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1joSig-00080r-9y for xen-devel@lists.xenproject.org; Thu, 25 Jun 2020 14:19:14 +0000 X-Inumbo-ID: d8014360-b6ee-11ea-bb8b-bc764e2007e4 Received: from esa3.hc3370-68.iphmx.com (unknown [216.71.145.155]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id d8014360-b6ee-11ea-bb8b-bc764e2007e4; Thu, 25 Jun 2020 14:19:13 +0000 (UTC) Authentication-Results: esa3.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none IronPort-SDR: XQR5bV0GV/uKdCPmhTSFGjnXxOyqYpcmr2Cdiqy7pdyLXETKlL2TPSQJvhrGtHuGiLblpvQqVP JCIlCZQI8Yu3be2QrJwoAhK0L8bJUlbxMTs+R+1dvw6SRh9SISgsERSV2GG9E0mVD9A1iWoJLG aXDCAKnkRKTwkekNVnoSk/4tSzFnrOEQBZDfrjEdTvL2DBVf8FAKV+hMWE4W0vRFV1h5iOOm5j n5RRpSaR4Y5XG2ZCcQTX8g5Se0WWSdsAGHDs+J8G2JUYQibxKCVdZy5pk/lu8yiQRfoyh2Wm0H grQ= X-SBRS: 2.7 X-MesageID: 20923418 X-Ironport-Server: esa3.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.75,279,1589256000"; d="scan'208";a="20923418" From: Ian Jackson MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Message-ID: <24308.45659.314018.214428@mariner.uk.xensource.com> Date: Thu, 25 Jun 2020 15:19:07 +0100 To: Jan Beulich Subject: Re: [XEN RFC for-4.14] Re: use of "stat -" In-Reply-To: <7abcae45-6a58-ea7a-be8b-64be50b080a6@suse.com> References: <3bfd6384-fcaf-c74a-e560-a35aafa06a43@suse.com> <20200512141947.yqx4gmbvqs4grx5g@liuwe-devbox-debian-v2.j3c5onc20sse1dnehy4noqpfcg.zx.internal.cloudapp.net> <4b90b635-84bb-e827-d52e-dfe1ebdb4e4d@citrix.com> <814db557-4f6a-020d-9f71-4ee3724981e3@suse.com> <20200512195005.GA96154@mattapan.m5p.com> <049e0022-f9c1-6dc9-3360-d25d88eeb97f@citrix.com> <20200512225458.GA1530@mattapan.m5p.com> <24253.9543.974853.499775@mariner.uk.xensource.com> <0b449d5a-9629-8e41-5354-b985a063eba4@suse.com> <24307.32018.502303.817846@mariner.uk.xensource.com> <24308.42571.430322.191817@mariner.uk.xensource.com> <7abcae45-6a58-ea7a-be8b-64be50b080a6@suse.com> X-Mailer: VM 8.2.0b under 24.5.1 (i686-pc-linux-gnu) X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Wei Liu , Paul Durrant , Andrew Cooper , Jason Andryuk , Elliott Mitchell , "xen-devel@lists.xenproject.org" Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Jan Beulich writes ("Re: [XEN RFC for-4.14] Re: use of "stat -""): > I'm about to test this then, but to be honest I have no idea what > to do with the comment. I don't think I could properly justify its > deletion in the description (beyond saying it's not really true), > nor would I be certain whether to e.g. leave the test -ef part > there. You should delete the comment. You could replace it with its opposite. Something like: # Although /dev/stdin (ie /proc/self/fd/0) looks like a symlink, # stat(2) bypasses the synthetic symlink and directly accesses the # underlying open-file. So this works correctly even if the file # has been renamed or unlinked. > Also is there any reason to go through two symlinks then, rather > than using /proc/self/fd/$_lockfd directly? /dev/stdin is clearer, to my mind. (The tiny performence difference is not relevant here. It's also possible that at some point stat(1) might handle it specially.) Thanks, Ian.