From unknown Fri Jun 13 11:38:20 2025 X-Loop: help-debbugs@gnu.org Subject: bug#47940: tests/tail-2/inotify-dir-recreate.sh FAILs for remote filesystems that passes is_local_dir_ Resent-From: Carl Dong Original-Sender: "Debbugs-submit" Resent-CC: bug-coreutils@gnu.org Resent-Date: Wed, 21 Apr 2021 20:06:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 47940 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: 47940@debbugs.gnu.org X-Debbugs-Original-To: bug-coreutils@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.16190355174155 (code B ref -1); Wed, 21 Apr 2021 20:06:02 +0000 Received: (at submit) by debbugs.gnu.org; 21 Apr 2021 20:05:17 +0000 Received: from localhost ([127.0.0.1]:59871 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lZJ5y-00014q-H8 for submit@debbugs.gnu.org; Wed, 21 Apr 2021 16:05:16 -0400 Received: from lists.gnu.org ([209.51.188.17]:49164) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lZJ5v-00014g-IU for submit@debbugs.gnu.org; Wed, 21 Apr 2021 16:05:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51402) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lZJ5v-0004JA-DU for bug-coreutils@gnu.org; Wed, 21 Apr 2021 16:05:07 -0400 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:38063) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lZJ5t-0004uZ-AI for bug-coreutils@gnu.org; Wed, 21 Apr 2021 16:05:07 -0400 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 48C435C00F4 for ; Wed, 21 Apr 2021 16:05:04 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Wed, 21 Apr 2021 16:05:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=carldong.me; h= from:content-type:content-transfer-encoding:mime-version:subject :message-id:date:to; s=fm3; bh=2dnQr8L3MOaNrwaSv39nM7AQPfjmK6ZJ9 0FKA4uVVvA=; b=Yf/DwVW/Xpls5K8mvNzhKA4IiLgnvVqch6stpdb8GV+RB/vgM MgkHLN336CuLE2f4WFdPgTsAB1//YaF0qXss+kxMG8wJkUIFjNuGFHm412MPYpye j/I8u0Zb5b2bW3f6+4M2hiGiEXIXBlKMP31w+2DlZcNMMJfewH8eQ7mG+6eUQLC6 LiGVr8xlXb6csb0eQmTq44RuNd8RjoDUK2qr+yrZ/RL66tPSU6RdJzo8zdfuoGOa w0ou6ApnS9xWBEJHmq++PQTrbZAO7gom2SPmHmAuhWRrVUvqZvehV0XnUVR/Vwss 0F4AolnYgzKtj5kyF7wuh31E5sQQkKbY6z+pQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=2dnQr8 L3MOaNrwaSv39nM7AQPfjmK6ZJ90FKA4uVVvA=; b=gA88dDjA2xzbY5Lq8LI9Mw NgJ0ISzUgAkLnOy9SPjkx8klpIu++deuPuZHjZRJ6lwqleXgDKKYFB0Xun/PUeK5 j5WOOnhrvERNwFa1bzrdAHWhd/cJCw26tXadaLBqB1pzld6lN7pNaU25kcdhnOF/ XkpRp+uGu6bw3mSTfHy9Si2SP5eGv7Mx6vl6AEgbEuMaHmhuzYHkXhgpa56goqqn MAtbwR6wkGSqymaq1AOqBv+u1U525/AXYV/0kdhAi2cSYnuU/YWzp/E/Ur61+yv9 pihqI4VNmEN/fsqo1KpABWHM9c8XbAILwPSo1+q3Hl0ggtiI/JT8gcOhDVOr/9SQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrvddtkedgudegjecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecuogfuuhhsphgvtghtffhomhgrihhnucdlgeelmd enucfjughrpefhtgfgggfukfffvffosehtqhhmtdhhtdejnecuhfhrohhmpeevrghrlhcu ffhonhhguceotghonhhtrggtthestggrrhhlughonhhgrdhmvgeqnecuggftrfgrthhtvg hrnhephefftdegudeugfellefhieetvefgkeejfeduudehleetvdehieejffekvefhjeev necuffhomhgrihhnpehgihhthhhusghushgvrhgtohhnthgvnhhtrdgtohhmpdhgihhthh husgdrtghomhdpghhithhhuhgsrdhiohenucfkphepleeirddvfeelrddujedrvdegvden ucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegtohhnth grtghtsegtrghrlhguohhnghdrmhgv X-ME-Proxy: Received: from [192.168.0.6] (pool-96-239-17-242.nycmny.fios.verizon.net [96.239.17.242]) by mail.messagingengine.com (Postfix) with ESMTPA id DBE0024005A for ; Wed, 21 Apr 2021 16:05:03 -0400 (EDT) From: Carl Dong Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.4\)) Message-Id: Date: Wed, 21 Apr 2021 16:05:02 -0400 X-Mailer: Apple Mail (2.3608.120.23.2.4) Received-SPF: pass client-ip=66.111.4.29; envelope-from=contact@carldong.me; helo=out5-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.6 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.6 (--) Hi all, I am debugging a reproducible test failure in = tests/tail-2/inotify-dir-recreate.sh for coreutils 8.32. Logs: = https://gist.githubusercontent.com/dongcarl/d24bfe853cc5bd9402bba82c36513c= 07/raw/19b9a15c4b12edf601dd1504cdf4ec0ee0d9344c/inotify-dir-recreate.log Looking at the non-=E2=80=98+=E2=80=99 lines, and the final compare = diff, we can see that the =E2=80=9Cout=E2=80=9D file only contained the = string =E2=80=9Cinotify=E2=80=9D and nothing else. =46rom my understanding, it has to do with the fact that I=E2=80=99m = running this test in a directory which is on overlayfs, which is = considered =E2=80=9Cremote=E2=80=9D by tail (see `fremote(int, const = char*)`). The filesystem being =E2=80=9Cremote=E2=80=9D should = ordinarily trigger one of the 2 SKIP checks in this test, however, = neither check triggered a SKIP. Check 1: is_local_dir_ At the top of inotify-dir-recreate.sh, we invoke is_local_dir_ to make = sure that we=E2=80=99re in a =E2=80=9Clocal=E2=80=9D filesystem. = However, is_local_dir_ invokes `df --local`, which does not use = =E2=80=9C=E2=80=8Cfremote=E2=80=9D to determine filesystem locality, but = rather =E2=80=9Cread_file_system_list=E2=80=9D from gnulib. The = =E2=80=9Cme_remote=E2=80=9D field of the returned =E2=80=9Cmount_entry" = struct is then used to filter out entries which are non-local. However, = in the case of overlayfs, the =E2=80=9Cme_remote=E2=80=9D field will be = false, and it will be considered =E2=80=9Clocal=E2=80=9D by `df --local` TL;DR: is_local_dir_ =3D =E2=80=9Cis possibly local=E2=80=9D, but we = really want to check if =E2=80=9Cis possibly remote=E2=80=9D Check 2: Grepping for 'inotify (resources exhausted|cannot be used)' Here, we expect that if inotify cannot be used, tail will print an = indication to stderr and we can skip this test. However, this message is = not printed when inotify is disabled in the fast-failing codepath: = https://github.com/coreutils/coreutils/blob/v8.32/src/tail.c#L2490-L2512 I think the easiest fix might be to have tail output =E2=80=98inotify = cannot be used=E2=80=99 to stderr in the fast-failing disable case: = https://github.com/coreutils/coreutils/blob/v8.32/src/tail.c#L2490-L2496. It seems like this bug has been encountered by others as well: 1. = https://dnsglk.github.io/lfs/2018/06/28/lfs-coreutils-test-issue.html#inot= ify-dir-recreate 2. = https://github.com/containers/podman/issues/5493#issuecomment-598851397 Carl Dong contact@carldong.me "I fight for the users=E2=80=9D P.S. I believe the comment line for=C2=A0=E2=80=8C`is_local_fs_type` in = the generated `src/fs-is-local.h` needs to be fixed.