From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id KC3qMxj3TWXl1AAAG6o9tA:P1 (envelope-from ) for ; Fri, 10 Nov 2023 10:25:45 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id KC3qMxj3TWXl1AAAG6o9tA (envelope-from ) for ; Fri, 10 Nov 2023 10:25:44 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 495F65D79E for ; Fri, 10 Nov 2023 10:25:44 +0100 (CET) Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b="G2xrJ/eQ"; dmarc=pass (policy=none) header.from=posteo.net; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1699608344; a=rsa-sha256; cv=none; b=kTkuqfPvQ0hulKBe92Le4hAhWrV3H/0b8x/6tHlnW4AKS6aHn5x80zpP2VQtXBUDyb5Ap+ vOlyJVNyiT2jqn6EFUIAG+afWyzGTaIjKGFmp8co6ml5bwLc5QTRIy6p/oksoZfWr6MmvK zgAdz+f347rYCUYs0Go9RpodtJnAddryuQO1z4Co26YfnClWHkHvRvms2o1zwtHj3mkq8P irYAq8bF40JXf+9iTzxPIqjv3fXSDuU6YF/u+h9LfbxW6rqh37X2fhzss4cXsKnF2NmUhd wn3TFH1xLpXX7hwxl/QyTVdfbhtosOmoY1kZbKtKL2mhX0NlCl2AxU9CRerCLg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b="G2xrJ/eQ"; dmarc=pass (policy=none) header.from=posteo.net; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1699608344; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=tl8oBVxpUwQ/UusD7hhlnRQ/I6B0tIEA28Hx1GGYuLg=; b=m4Ouhdp4LXegirGEo6XKLkcxWMMaOdWZpUJ3zFgNgSU+4Sv0r7uiV2+SzIi3tthxdxte7+ /69iDbMGfVbDG582exEqfgtS1qMhDeRIibyq/0XFILwJO8tiK8Y+DqrKcNdFBT48lG5LdK pFSMH+puXmavRxaekdWg8DtKJeweJkblcNN1gQkoseLV3UHU8v8/9NtMpatxdUI4GGNxMb id8V4devMAL9YoXYwghq/oX1rcruMy6QiMbzCk5i9EZvd2iTvZ+Bnd6GO74ygi5eQk98b9 Hh7R2GkyCtbNRGdQezzkCkTqn4aG+EGryehlmlWdpqWV+oilezBqznGMwNE6wA== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r1Nl9-0007Sg-Ml; Fri, 10 Nov 2023 04:25:03 -0500 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 1r1Nl7-0007RR-Uu for emacs-orgmode@gnu.org; Fri, 10 Nov 2023 04:25:02 -0500 Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r1Nl5-000415-9u for emacs-orgmode@gnu.org; Fri, 10 Nov 2023 04:25:01 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 42834240106 for ; Fri, 10 Nov 2023 10:24:55 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1699608295; bh=xN84JY6sxvdXKwz1pyWhnvav36aXRxShtTCRC12KRkQ=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From; b=G2xrJ/eQJQ2VXEvaoRejVMpMP08qZG3dFfZBo4LdAtvATaEKflSoIQwHwUWi8NL6U 0nR6fTfr475S/xkr+N2ACsy9Xb+tsYiOK/+8cKOMV0JjgUeeBB873OxN1iVQ2i+cB2 1y2Wt5YFhCBk6rJThYHuzw2VmBefHBxNmRGTun3TrwMTjyGP1q9xRDjRfarypHypXT Pr4l17Xq3f+IzP+gVKXfaNpTBJMT+RvT746PEcWnjuYJpZ83lmHnisfscuu6TBl1vT 9pLhRXFFnmULCDwqN+jaPrIkIXJc4kGmEABgD41ByVG5Gf7ERJ500rotLD4nOZOoRL tYiyr9CHZf9jg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4SRYLt3yfHz6txB; Fri, 10 Nov 2023 10:24:54 +0100 (CET) From: Ihor Radchenko To: Fabio Natali Cc: emacs-orgmode@gnu.org Subject: Re: Issue with org-persist and Tramp In-Reply-To: <87ttpvgjg5.fsf@fabionatali.com> References: <87jzqthdge.fsf@fabionatali.com> <87msvofvgx.fsf@localhost> <87a5roi1na.fsf@fabionatali.com> <87h6lw2kg9.fsf@localhost> <875y2chr1f.fsf@fabionatali.com> <8734xf2k9v.fsf@localhost> <87ttpvgjg5.fsf@fabionatali.com> Date: Fri, 10 Nov 2023 09:26:58 +0000 Message-ID: <87r0ky0xi5.fsf@localhost> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=185.67.36.66; envelope-from=yantar92@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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_MED=-2.3, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Queue-Id: 495F65D79E X-Migadu-Scanner: mx12.migadu.com X-Migadu-Spam-Score: -9.31 X-Spam-Score: -9.31 X-TUID: xH90ArlKGo4r --=-=-= Content-Type: text/plain Fabio Natali writes: > On 2023-11-09, 12:17 +0000, Ihor Radchenko wrote: >> May I know what >> (file-remote-p "/ssh::/home/user/test.org") >> (with appropriate ) returns on your side? > > Hi Ihor, > > Sure, no particular reason to obfuscate the remote address, it's > actually a LAN IP. The above function returns "/ssh:192.168.1.100:". Is > that the kind of output one should be expecting? Anything wrong about > it? Nothing wrong. Just me missing one code branch. What about the attached patch? --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=v2-0001-org-persist-normalize-associated-Avoid-TRAMP-conn.patch >From 73e2fc687b966f3c12b87dd40c90cdc6b9f440fc Mon Sep 17 00:00:00 2001 Message-ID: <73e2fc687b966f3c12b87dd40c90cdc6b9f440fc.1699608346.git.yantar92@posteo.net> From: Ihor Radchenko Date: Wed, 8 Nov 2023 19:58:42 +0200 Subject: [PATCH v2] org-persist--normalize-associated: Avoid TRAMP connection for remote files * lisp/org-persist.el (org-persist--normalize-associated): Never try to store inode association for remote TRAMP files. Reported-by: Fabio Natali Link: https://orgmode.org/list/87jzqthdge.fsf@fabionatali.com --- lisp/org-persist.el | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/lisp/org-persist.el b/lisp/org-persist.el index 81edcf6f2..bdc6006b6 100644 --- a/lisp/org-persist.el +++ b/lisp/org-persist.el @@ -614,9 +614,14 @@ (defun org-persist--normalize-associated (associated) (unless (stringp associated) (setq associated (cadr associated))) (let* ((rtn `(:file ,associated)) - (inode (and (fboundp 'file-attribute-inode-number) - (file-attribute-inode-number - (file-attributes associated))))) + (inode (and + ;; Do not store :inode for remote files - it may + ;; be time-consuming on slow connections or even + ;; fail completely when ssh connection is closed. + (not (file-remote-p associated)) + (fboundp 'file-attribute-inode-number) + (file-attribute-inode-number + (file-attributes associated))))) (when inode (plist-put rtn :inode inode)) rtn)) ((or (pred bufferp) `(:buffer ,_)) @@ -634,6 +639,10 @@ (defun org-persist--normalize-associated (associated) (or (buffer-base-buffer associated) associated))) (setq inode (when (and file + ;; Do not store :inode for remote files - it may + ;; be time-consuming on slow connections or even + ;; fail completely when ssh connection is closed. + (not (file-remote-p associated)) (fboundp 'file-attribute-inode-number)) (file-attribute-inode-number (file-attributes file)))) -- 2.42.0 --=-=-= Content-Type: text/plain -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at --=-=-=--