From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.bugs Subject: bug#66381: 29.1; Auto-revert not polling files when notifications are enabled Date: Sun, 08 Oct 2023 14:38:22 +0200 Message-ID: <87cyxpffwh.fsf@gmx.de> References: <83jzrz0xeq.fsf@gnu.org> <87bkdaihuo.fsf@gmx.de> <87il7igybs.fsf@gmx.de> <875y3igvp3.fsf@gmx.de> <83fs2mz3r6.fsf@gnu.org> <83edi6z294.fsf@gnu.org> <87il7hfrnj.fsf@gmx.de> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14367"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 66381@debbugs.gnu.org, Daniel Jacobowitz To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Oct 08 14:39:02 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qpT3l-0003VV-Ti for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 08 Oct 2023 14:39:02 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qpT3T-00061O-8P; Sun, 08 Oct 2023 08:38:43 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qpT3S-00061G-D8 for bug-gnu-emacs@gnu.org; Sun, 08 Oct 2023 08:38:42 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qpT3S-0001mB-5A for bug-gnu-emacs@gnu.org; Sun, 08 Oct 2023 08:38:42 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qpT3l-00043z-T8 for bug-gnu-emacs@gnu.org; Sun, 08 Oct 2023 08:39:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Michael Albinus Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 08 Oct 2023 12:39:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66381 X-GNU-PR-Package: emacs Original-Received: via spool by 66381-submit@debbugs.gnu.org id=B66381.169676873215603 (code B ref 66381); Sun, 08 Oct 2023 12:39:01 +0000 Original-Received: (at 66381) by debbugs.gnu.org; 8 Oct 2023 12:38:52 +0000 Original-Received: from localhost ([127.0.0.1]:56486 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qpT3b-00043b-Qf for submit@debbugs.gnu.org; Sun, 08 Oct 2023 08:38:52 -0400 Original-Received: from mout.gmx.net ([212.227.15.19]:43581) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qpT3Z-00043K-JB for 66381@debbugs.gnu.org; Sun, 08 Oct 2023 08:38:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1696768703; x=1697373503; i=michael.albinus@gmx.de; bh=xJ6cTUS0ecoFOjb1yaQY2P/sXwdRjAA09sSkk4EOa80=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date; b=o+bbgM7qrlZHwhOEZOHCJSz1iug/OFDILOhQ7xKbeoTTZqvfwj77E3vZ/2vJDaCNedbNsmyvuRk 9pzp+xGLqJ7q+Y7+uO7UXvuW/7pxrMEMMLQILLcMCMiYwM+F0cY4gwoisVHU2a2iYRRZ/Tjp9uVT4 NSwvNIIMB/SUSmeUh3hGvlwVBdW/+uuNLEqVodF5ZYUH2Q1tkhXBa0BsOgEWvJ/03vFsRv39ki4PL F6JZcZr62BdWvd9fyMPqS7EoILDJ32cMIg4QfUxmzssbnM+ZqkCoklw4V7Bw6XGFfBFi+22VAmgYx WPYrdKDfyaSq8edDT5rJvkeVKCfzZaJMr5QA== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Original-Received: from gandalf.gmx.de ([185.89.39.30]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1Md6Qr-1rOFdV40NH-00aELt; Sun, 08 Oct 2023 14:38:23 +0200 In-Reply-To: <87il7hfrnj.fsf@gmx.de> (Michael Albinus's message of "Sun, 08 Oct 2023 10:24:32 +0200") X-Provags-ID: V03:K1:rAZ3PaHfrqZeqBLyZTiUjWFqHGASNWHb9OloEQr8/Dh/S7pCih9 HPGbsfolEiihyAuJ9i+Oru6yXvkITRPPTh0QpxEEhSQjAfSVrw/CNMJNUPsk4Nd3/s1u9Ct AO4SB593DW0QAFcV06m14PIz2njtNa8s4L/KrNtSsPvJNplGLCRDEuLZJw+tuOwBiW/LdwK pelYVzkLaqh2i37HN0RUg== UI-OutboundReport: notjunk:1;M01:P0:cDOcJxltkJM=;dR1VZxVst8gRUL3OhQ9Cjfw+Ovq hgXeS64PAoVsNcUEEz0k+Dt4ujTr5dCPFBjIVZ7V1TB3af0AoiPKbF7GX4W+m5vDlHLhBA9Ul n07tl6K0ntezCuHG2RksCSkmQRRe0vO48kKyiC6p9/zvwnc6pzoxejkGRAvzEGAJd2meAaB+l BIbvFvlyI4i/MV3H46G00hsOp5y3xsRCG/WiOI6SYWgiraeiQ29/3F4OCB9l6ZhpC8/X5pi/L Xput1uKL6BYDQub/jBjcqcVTc0mgFwqzzLNfhjoU1LMeVWgGpBooMIpm6pFHkg8f41odXn92/ bY6cLN42Hv31FV5Vn7OLaUzLMQG0GHEx2he1tr/5q/6HhZ4COHifKoGqk72VO5tT+n7/u2K0b 8O4ZyhIR8OkLgTLjzZtoCuZk70ydHYHGwpp47NVtFJrLsb5Vo6KpFCU9NpvzQ/eTWyHdok0It GgomynEx5ofmeMS/VeNmgJW95pkhvJryKVHGWjU3i4ZuSw5ks24IzHFybCtKVnDFe3JBdYBMk POtPX+lM8InxFR77wGRu0GnNy8os35pfWLvKOBoPX8VWyFNG0zbVszEAl5jVayU2mg22r+8/l J1t9isKrbVe/iGy0bIDS8jYgpsHjgkWT9LOj9P0sTh3LIIR2qXj8dw45jP8CAUHHe0EiFEqZp OH11SxJGxQhiZrX9hHPNtL1s+Ixs4F6opv1LoM788Dk5jXa9E3XrO/EciueGrz76gLwE6Jvhx 43KypNpZf8Dro5DXQ2Qu95N4lebC46/ox1N8fG4zi058OT/pq5Tnh3bfg0bT7LsyTux+O7L/ X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:272092 Archived-At: --=-=-= Content-Type: text/plain Michael Albinus writes: Hi, > The problem is, that in Daniel's case we get no information that file > notification has ceased to work for the re-mounted file system (no > IN_IGNORED event from inotify). auto-revert-notify-watch-descriptor > still exists, and auto-revert-notify-modified-p isn't modified any > longer. Therefore the file is not reverted even while polling. I've debugged further, and it looks like there is a gap in forwarding the IN_IGNORED event from inotify.c to filenotify.el. Oops. Daniel, could you pls try the appended patch? It shall enable this to work, meaning auto-revert-mode is informed about the unmounted file system. I've tested with an NFS mount, 'tho. Best regards, Michael. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment Content-Transfer-Encoding: quoted-printable diff --git a/lisp/filenotify.el b/lisp/filenotify.el index e9f8d4e515d..16a154723b8 100644 =2D-- a/lisp/filenotify.el +++ b/lisp/filenotify.el @@ -138,7 +138,7 @@ file-notify--callback-inotify ((memq action '(delete delete-self move-self)) 'd= eleted) ((eq action 'moved-from) 'renamed-from) ((eq action 'moved-to) 'renamed-to) - ((eq action 'ignored) 'stopped))) + ((memq action '(ignored unmount)) 'stopped))) actions)) file file1-or-cookie)) @@ -202,7 +202,7 @@ file-notify-callback ((memq action '(delete delete-self move-self)) 'deleted) ((eq action 'moved-from) 'renamed-from) ((eq action 'moved-to) 'renamed-to) - ((eq action 'ignored) 'stopped))) + ((memq action '(ignored unmount)) 'stopped))) (if (consp actions) actions (list actions)))) file file1-or-cookie)) @@ -339,7 +339,7 @@ file-notify--add-watch-inotify "Add a watch for FILE in DIR with FLAGS, using inotify." (inotify-add-watch dir (append - '(dont-follow) + '(dont-follow ignored unmount) (and (memq 'change flags) '(create delete delete-self modify move-self m= ove)) (and (memq 'attribute-change flags) diff --git a/src/inotify.c b/src/inotify.c index 105ff5a9d8a..247d9f03055 100644 =2D-- a/src/inotify.c +++ b/src/inotify.c @@ -148,6 +148,11 @@ symbol_to_inotifymask (Lisp_Object symb) else if (EQ (symb, Qonlydir)) return IN_ONLYDIR; + else if (EQ (symb, Qignored)) + return IN_IGNORED; + else if (EQ (symb, Qunmount)) + return IN_UNMOUNT; + else if (EQ (symb, Qt) || EQ (symb, Qall_events)) return IN_ALL_EVENTS; else --=-=-=--