Subject: bug#54016: 29.0.50; TRAMP + sshfs says constantly that file changed

From: Ergus <[email-masked]>
Date: Wed, 16 Feb 2022 12:07:09 +0100

On Wed, Feb 16, 2022 at 09:28:13AM +0100, Michael Albinus wrote:
>Ergus via "Bug reports for GNU Emacs, the Swiss army knife of text
>editors" <[email-masked]> writes:
>
>> Hi:
>
>Hi,
>
>> Using tramp+sshfs it works pretty much fine at the beginning but after
>> some minutes it interrupts constantly saying that the file changed on
>> disk and asks for edit confirmation.
>>
>> By constantly I mean every time a new edit is attempt I get this (even
>> several times consecutive).
>>
>> ```
>> Saving file /sshfs:XXX:XXXX
>> benchmarks_ompss.h has changed since visited or saved.  Save anyway? (y or n) y
>> benchmarks_ompss.h changed on disk; really edit the buffer? (y, n, r or C-h) y
>> File on disk now will become a backup file if you save these changes.
>> Wrote /sshfs:XXX:XXXX
>> ```
>
>Well, I would need a recipe to reproduce. Could you run it, when
>tramp-verbose is set to 10? And please tell me at which time the problem
>starts to appear, so I have a chance to find it in the debug buffer.
>
>I know that the debug buffer will be huge after a while, but there is no
>problem if you send it directly to me (or a URL where I could find it).
>

1) C-x C-f /sshfs:mn3:/home/ergus/cholesky_ompss2/cholesky_utils.c
2) edit and save (C-x C-f)

3) Try to edit again:

and get the message:

```
cholesky_utils.c changed on disk; really edit the buffer? (y, n, r or C-h) y
File on disk now will become a backup file if you save these changes.
```

While this is printed in the debug buffer.

```
12:00:00.545261 tramp-handle-lock-file (1) # Quit: "Quit", ""
12:00:11.644888 tramp-get-file-property (8) # /home/ergus/cholesky_ompss2/cholesky_utils.c file-attributes-nil undef; inhibit: t; cache used: nil; cached at: 11:59:49
12:00:11.650265 tramp-get-file-property (8) # /home/ergus/cholesky_ompss2/cholesky_utils.c local-file-name undef; inhibit: t; cache used: nil; cached at: 11:59:49
12:00:11.651051 tramp-get-connection-property (7) # process-buffer nil; cache used: t
12:00:11.651728 tramp-get-connection-property (7) # mount-point nil; cache used: nil
12:00:11.653042 tramp-get-file-property (8) # / mounted nil; inhibit: 10; cache used: nil; cached at: 11:59:41
12:00:11.693504 tramp-fuse-mounted-p (6) # mount -t fuse.sshfs
mn3:/ on /tmp/tramp.sshfs.mn3 type fuse.sshfs (rw,nosuid,nodev,relatime,user_id=1000,group_id=985)
12:00:11.694366 tramp-set-file-property (8) # / mounted mn3:/
12:00:11.695260 tramp-get-connection-property (7) # process-name nil; cache used: nil
12:00:11.695738 tramp-set-connection-property (7) # connected t
12:00:11.696147 tramp-get-connection-property (7) # uid-integer 1000; cache used: t
12:00:11.696682 tramp-get-connection-property (7) # gid-integer 985; cache used: t
12:00:11.697156 tramp-get-connection-property (7) # uid-string ergo; cache used: t
12:00:11.697708 tramp-get-connection-property (7) # gid-string users; cache used: t
12:00:11.698783 tramp-get-connection-property (7) # mount-point nil; cache used: nil
12:00:11.700314 tramp-set-file-property (8) # /home/ergus/cholesky_ompss2/cholesky_utils.c local-file-name /tmp/tramp.sshfs.mn3/home/ergus/cholesky_ompss2/cholesky_utils.c
12:00:11.901823 tramp-set-file-property (8) # /home/ergus/cholesky_ompss2/cholesky_utils.c file-attributes-nil (nil 1 1000 985 (24621 18268 0 0) (25100 55619 0 0) (25100 55619 0 0) 9971 -rw-r--r-- t 59 44)
12:00:11.905766 tramp-get-file-property (8) # /home/ergus/cholesky_ompss2/cholesky_utils.c file-attributes-nil (nil 1 1000 985 (24621 18268 0 0) (25100 55619 0 0) (25100 55619 0 0) 9971 -rw-r--r-- t 59 44); inhibit: 120; cache used: t; cached at: 12:00:11
12:00:24.093022 tramp-get-file-property (8) # /home/ergus/cholesky_ompss2/ file-attributes-nil (t 1 1000 985 (25100 55571 0 0) (24778 8283 0 0) (24778 8283 0 0) 4096 drwxr-xr-x t 27 44); inhibit: 120; cache used: t; cached at: 11:58:59
12:00:24.093775 tramp-get-file-property (8) # /home/ergus/cholesky_ompss2/ file-attributes-nil (t 1 1000 985 (25100 55571 0 0) (24778 8283 0 0) (24778 8283 0 0) 4096 drwxr-xr-x t 27 44); inhibit: 120; cache used: t; cached at: 11:58:59
```

This is the output only after 3) The buffer was full of other stuff
before (attached in the previous email)