Hello. I've asked a question here (https://unix.stackexchange.com/questions/115757/bind-mount-unable-to-delete-files-to-trash) about strange situation with deleting files from bind-mounted directories. Someone Ricky Beam supposed this is a kernel issue. This is a quote of his words: [QUOTE] This is a linux kernel issue. It's not looking at the true super-block of the source and destination filesystems: 17926 rename("d1/foo", "d2/foo") = -1 EXDEV (Invalid cross-device link) Looks like the issue is in do_rename() (fs/namei.c): error = -EXDEV; if (oldnd.mnt != newnd.mnt) goto exit2; *sigh* [/QUOTE] Could you please take a look at this issue and confirm or disprove this is a kernel issue? Thank you very much!
I also found this old bug: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=698640 Could you please check this and give me right direction? Thank you once again!
rename(2) doesn't cross mountpoints. That's how Unix always worked. dup #14849
Alexey, Okay, so is this kernel issue or not? What about my question about bind-mounted directories? Does it relate to code provided above? Thank you in advance!
You can not delete files to Trash because code internally does rename(2) which doesn't work because rename formally crosses mountpoint. Code can be improved, namely; * try rename(2) * if EXDEV, copy+unlink
kernel can be improved by option to allow rename to succeed if rename crosses filesystem not mountpoint, but userspace code would have the same problem: file and Trash on another fs.
Alexey, thanks for answer! But this means that one cannot use bind-mounted directories 'normally', because there is no way to 'trash' files from such places, and the only way to delete files is permanent deleting without any possibility to restore such data. And there is not much sense of using bind-mounted directories because of that obscure behavior. Am I right or I missed something?
Your best bet is to file a bug against your desktop environment vendor and ask to implement EXDEV:copy+unlink fallback.
Thanks!
Did someone opened a "bug against [any] desktop environment"?
Indeed, did someone open a bug against any desktop environment? Ubuntu is force-feeding snap to its users and snap requires mounted home directories (rather than symlinks).
I hitted this recently. Bug opened against Xfce. https://gitlab.xfce.org/xfce/thunar/-/issues/714