Subject: bug#58721: 28.2; dired with delete-by-moving-to-trash can't trash directory twice

From: Eli Zaretskii <[email-masked]>
Date: Fri, 28 Oct 2022 10:46:56 +0300

> From: Gustavo Barros <[email-masked]>
> Date: Thu, 27 Oct 2022 19:01:27 -0300
> Cc: [email-masked]
> 
> At the end of the function, the call is done to:
> 
>     (rename-file fn new-fn overwrite)
> 
> But, when the operation is crossing filesystems and the file is large
> enough, the `rename-file' will fail with "file exists", despite the
> `OK-IF-ALREADY-EXISTS' argument being `t'.

This sounds very strange.  Why would the failure depend on the size of
the file/directory and on whether it does or doesn't cross
filesystems?  I see nothing in the code involved in this that could
cause that.  Perhaps on your system something happens in the
background, due to one of the filesystems being encrypted or
something?