From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf1-x12a.google.com (mail-lf1-x12a.google.com [IPv6:2a00:1450:4864:20::12a]) by sourceware.org (Postfix) with ESMTPS id E76803858C2A for ; Tue, 26 Sep 2023 05:13:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E76803858C2A Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-lf1-x12a.google.com with SMTP id 2adb3069b0e04-5041cc983f9so12830363e87.3 for ; Mon, 25 Sep 2023 22:13:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1695705191; x=1696309991; darn=cygwin.com; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=ndyfzqXXPU/xoYAb8RmpA15JAX8KDu2CP8gsIldfsCM=; b=KoKySsyuD5OHOW0jLg+PYBoPBzh+Y7jCLjJQYhPNW0s+2/Amx3Zyvl7Xy7LHUErkFd /9FgU6cWZFxgnlBVLkL/dzt1Z0FEK/+HLNypZ0RMfM69oPa0tqPP816HhmR3ZiohOBcn pDlSoLEYiwOd/BomXlNrff8cK/T7faqYeqkuBufMP30drVkr0pA6gZSkDywixnXDlwT3 20LlmgpUm8IDZ6J+VlEBMK53TK6jhrKqOFMM+jDgglHxOLWJ3VdB++hkvroQVWMwCez4 Noc5jjA/SR04WjtVTYWgXjdTTRjVVCC0vFMDnUv+xIvilNFS+r0RaMOYaUQXnPKhQX8t 2o0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695705191; x=1696309991; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ndyfzqXXPU/xoYAb8RmpA15JAX8KDu2CP8gsIldfsCM=; b=Z5zOiop0gbVZKOYbyvVCzL3eybDMqEw/cP23d+A7C+ucrzd5kYLnQQB0bnh7ymMJ7t /UHnVct/THcEJGwCeoqZGbLJ6IgggzMaerLv5F2eT45ci8KyaY7zkmzAv7GLmCZWd3E8 hu5jjWO1VCJmJw5bny7LZouikv1OW5kx/1QcQ5Hwi6xIiCNRGDq2ERwj5dxjZ7ME0ICK yfh0VGofT42u5SRY0Ot6MJ8bbBDWBN5vL0hN5+IwR0NO8k0QP8wBQxxGhgKkrP9Biqf+ yNeZkrCaQJpeLGAakYVZYv8dgwfbS1ExksxS6NFslZG67k0k8VxbP4FsVlZ+9WvRxd32 ARcw== X-Gm-Message-State: AOJu0YwHHMMD+rDKq09s5eyTUJQhFtsY/qcY7id7+ATOdlRl+gFegSCc f1wfcXZ1hteM7NyoZ08v+7LiKT9NTO0arXC/5ApPQBJqVlA= X-Google-Smtp-Source: AGHT+IGqUst7yDpF6MCMmzBw5T2GcB652XH0gKM92BLyEGjzhU2kcpt57Tu6Li8lHiwELr3V5V6EL8uV44ts5k6F4b8= X-Received: by 2002:ac2:515c:0:b0:501:c1d4:cf68 with SMTP id q28-20020ac2515c000000b00501c1d4cf68mr7924474lfd.15.1695705191389; Mon, 25 Sep 2023 22:13:11 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Cedric Blancher Date: Tue, 26 Sep 2023 07:12:35 +0200 Message-ID: Subject: Re: Cygwin generates syscalls for *.lnk files on filesystems with native symlink support? To: cygwin@cygwin.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=0.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Fri, 1 Sept 2023 at 13:00, Corinna Vinschen via Cygwin wrote: > > On Sep 1 06:23, Cedric Blancher via Cygwin wrote: > > Good morning! > > > > During a Cygwin 3.4.8-1.x86_64 debugging session I noticed something > > odd when I looked at the network traffic generated by one of our > > cluster nodes: > > It seems that for each call to a tool (i.e. starting "sed" from > > "bash") Cygwin searches for *.lnk files. > > > > Is this correct even when the filesystem in question has native > > symlink support (e.g. NFS)? > > Yes. During file handling, Cygwin doesn't know what filesystem a > file is on until it could actually open the file and request file > and filesystem info from the open handle. So if Cygwin couldn't open > "foo" because the NtCreateFile call returned with status > STATUS_OBJECT_PATH_NOT_FOUND or STATUS_OBJECT_NAME_NOT_FOUND, or > STATUS_NO_SUCH_FILE, or one of the countless other status codes the > kernel (or the driver) might return in case a file doesn't exist, > it will tack on .lnk and .exe and, for historical reasons, .exe.lnk, > and try again. Our concern here is that this produces an absurd amount of extra syscalls (6x more!!, compared to native POSIX), which hurts CIFS and NFS performance. The example with calling sed in a script is especially BAD, as trying to execute "sed" in a bash shell script leads it try for sed.exe, sed.sh, sed.bat, multiplied by looking for *.lnk files (i.e. sed.exe.lnk, sed.sh.lnk, sed.bat.lnk). And what finally made my brain go BOOM was the (IMO) absurd combination like "sed.bat.exe.lnk" Ced -- Cedric Blancher [https://plus.google.com/u/0/+CedricBlancher/] Institute Pasteur