From mboxrd@z Thu Jan 1 00:00:00 1970
Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail
From: Philipp Stephani
Newsgroups: gmane.emacs.bugs
Subject: bug#54126: 29.0.50;
C-x x g doesn't always correctly revert SSHFS files
Date: Fri, 18 Mar 2022 17:21:54 +0100
Message-ID:
References: <87v8x5mx7q.fsf@gmx.de>
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214";
logging-data="26729"; mail-complaints-to="usenet@ciao.gmane.io"
Cc: 54126@debbugs.gnu.org
To: Michael Albinus
Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Mar 18 17:23:17 2022
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 1nVFNl-0006o2-At
for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 18 Mar 2022 17:23:17 +0100
Original-Received: from localhost ([::1]:58852 helo=lists1p.gnu.org)
by lists.gnu.org with esmtp (Exim 4.90_1)
(envelope-from )
id 1nVFNj-0007ab-PW
for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 18 Mar 2022 12:23:15 -0400
Original-Received: from eggs.gnu.org ([209.51.188.92]:60828)
by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
(Exim 4.90_1) (envelope-from )
id 1nVFNW-0007aT-C7
for bug-gnu-emacs@gnu.org; Fri, 18 Mar 2022 12:23:02 -0400
Original-Received: from debbugs.gnu.org ([209.51.188.43]:36072)
by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
(Exim 4.90_1) (envelope-from )
id 1nVFNW-0007bV-3R
for bug-gnu-emacs@gnu.org; Fri, 18 Mar 2022 12:23:02 -0400
Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2)
(envelope-from ) id 1nVFNV-0001bY-Oj
for bug-gnu-emacs@gnu.org; Fri, 18 Mar 2022 12:23:01 -0400
X-Loop: help-debbugs@gnu.org
Resent-From: Philipp Stephani
Original-Sender: "Debbugs-submit"
Resent-CC: bug-gnu-emacs@gnu.org
Resent-Date: Fri, 18 Mar 2022 16:23:01 +0000
Resent-Message-ID:
Resent-Sender: help-debbugs@gnu.org
X-GNU-PR-Message: followup 54126
X-GNU-PR-Package: emacs
Original-Received: via spool by 54126-submit@debbugs.gnu.org id=B54126.16476205336098
(code B ref 54126); Fri, 18 Mar 2022 16:23:01 +0000
Original-Received: (at 54126) by debbugs.gnu.org; 18 Mar 2022 16:22:13 +0000
Original-Received: from localhost ([127.0.0.1]:58202 helo=debbugs.gnu.org)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from )
id 1nVFMj-0001aG-1p
for submit@debbugs.gnu.org; Fri, 18 Mar 2022 12:22:13 -0400
Original-Received: from mail-oi1-f177.google.com ([209.85.167.177]:40540)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from ) id 1nVFMh-0001a0-Ih
for 54126@debbugs.gnu.org; Fri, 18 Mar 2022 12:22:12 -0400
Original-Received: by mail-oi1-f177.google.com with SMTP id o64so9262272oib.7
for <54126@debbugs.gnu.org>; Fri, 18 Mar 2022 09:22:11 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
h=mime-version:references:in-reply-to:from:date:message-id:subject:to
:cc; bh=CYrxG1Lg3DsIgv4spQ3TnoP1og0MzljPHmyd0duNmwc=;
b=V7YsVya2Oanymi/aawEtwzq6h2uxh9GlGemwiUFbOjSW5NxcpAS3uz77k+YttPpHix
qWDeG6q9Z9nkVep//2R/n7Z3RU0QXhqpkcaqOliRloA7g/wPmavMWUkDr+e5fiWDczwW
Zamsq4k1wZe7Aunv2yrcfjz8cGVbVSOVYWIfg9DeyNgfUKbuuQIptOqVKGyft5YbFS0l
KnvyMJ7FPu/Qr2caT9uBhXZ1eY0SgCCB+kPhsInAiD+Bmy/dqOGPoJfSYVF1hld35rAL
PrHFJOtvwM7RHzcGFOxcjLf6Vz5OL8iPc8Wk4XA5PDcSJJY2j+wXycq8KFqQvtJOZ8R2
R8iw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20210112;
h=x-gm-message-state:mime-version:references:in-reply-to:from:date
:message-id:subject:to:cc;
bh=CYrxG1Lg3DsIgv4spQ3TnoP1og0MzljPHmyd0duNmwc=;
b=zy1Wxcjcr1Q6l2RjAboqvNSyEoNeg/Jh9jXwOwon8KJF3SkK7sXpZ54Jfif3hK6p1l
mIHZiboOZ88SiomDf0GP3ZSMqBf4ebxsqEvU+jXtU1ib8h5Qr2EklSrvDGbNSfuPWry1
0lH882qkJJptsLrVsGtX5bB68J49P6JL5O/UvfC7rLCQLujrypz6HIOHfwmMWbP5uDwj
xSrHHmyP9bb7atz5PW+UpT1OkprLqkwxlV7g3Qw5HoeRP8gXxhu0uFdsoLulS63DQbC+
5ERjkWq9QrxdCPIoBnydIGGxTlzmQL2OVDhXL4SsoVpI6QH8ro5NCjJzuYT1ULjsOkEq
/4Fw==
X-Gm-Message-State: AOAM533bM8zmXyu0o8Xy7V/oqND9SI1YYAoDxMg+n03k3cbUM0SaA1x9
x4g9bQqNOh0SrCM3qsAg3CtipoahgCX30aMOiC0=
X-Google-Smtp-Source: ABdhPJx8rHiYu2yTUOhMzYRIfHc0b8kgyzKxZ/Jyuu4NFy0dH0jDrccq0sNQgajxWOFUsxo5bYzN2+KJfP8nmQTZ8+4=
X-Received: by 2002:a05:6808:1d8:b0:2da:51e0:d0ef with SMTP id
x24-20020a05680801d800b002da51e0d0efmr4597269oic.57.1647620525447; Fri, 18
Mar 2022 09:22:05 -0700 (PDT)
In-Reply-To: <87v8x5mx7q.fsf@gmx.de>
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"
Xref: news.gmane.io gmane.emacs.bugs:228555
Archived-At:
Am Mi., 23. Feb. 2022 um 16:14 Uhr schrieb Michael Albinus
:
>
> Philipp Stephani writes:
>
> Hi Philipp,
>
> > At least on my system the following happens often, but not always:
> >
> > Create some file whose contents don't really matter. In my case:
> >
> > $ cat /tmp/a.c
> > int main(void) {
> > return 0;
> > }
> >
> > Visit the file over SSHFS:
> >
> > $ emacs -Q /sshfs:localhost:/tmp/a.c
> >
> > Now, outside of Emacs, append something to the file:
> >
> > $ echo aaaaa >> /tmp/a.c
> >
> > Immediately after that, back in Emacs, hit C-x x g. The new content
> > isn't there. Only after reverting the buffer a second time it appears.
> > First I thought this was a timing/cache coherency issue, but even
> > waiting for 10 seconds doesn't fix it in most cases. Somewhat
> > surprisingly, switching to a different buffer in between appears to make
> > the problem go away (in some cases at least).
>
> Looks like you are plagued by caching. revert-buffer reverts a file
> only, if it is modified on disk. Tramps caches file attributes by
> default for 10 seconds (see remote-file-name-inhibit-cache). Set this
> value to t in order to test, whether it makes a difference. However, you
> have said you did wait for 10 seconds, so maybe this isn't the reason.
I didn't use a stopwatch :-)
So if the cache timeout is really exactly 10 seconds, then it's rather
likely I was affected by it.
This doesn't seem to happen with SSH, only with SSHFS, though. Does
the caching behavior differ? I.e., is the SSH backend stricter about
cache coherency?
It's also worth noting that Unix tools generally expect filesystems to
be sequentially consistent (i.e. any modification is immediately
visible by any other consumer, and there's a strict ordering between
operations). Caching is still possible, but it shouldn't break these
consistency guarantees.
>
> Another cache might come from sshfs itself. Tramp calls sshfs like
> "sshfs localhost:/ /tmp/tramp.sshfs.localhost -C -o idmap=user,reconnect".
> See tramp-mount-args settings in tramp-sshfs.el, line 33-34. You might
> try to add other options, like "-o no_readahead" or "-o sync_readdir",
> see sshfs(1). Don't forget to unmount the sshfs mount point, before you
> start a new Emacs session with changed options.
I'll play around with that, thanks for the hint.
If this turns out to be the problem, then caching should probably be
disabled by default, because sequential consistency is more important
than potential speed-ups.