From: Robert Pluim <rpluim@gmail.com>
To: Bernardo <bernardo.bacic@pobox.com>
Cc: 37884@debbugs.gnu.org
Subject: bug#37884: 27.0.50; Cannot write to a file in VirtualBox shared directory
Date: Thu, 24 Oct 2019 18:10:59 +0200 [thread overview]
Message-ID: <m2zhhqqjeg.fsf@gmail.com> (raw)
In-Reply-To: <87h83zeoy1.fsf@pobox.com> (Bernardo's message of "Wed, 23 Oct 2019 21:28:06 +1100")
>>>>> On Wed, 23 Oct 2019 21:28:06 +1100, Bernardo <bernardo.bacic@pobox.com> said:
Bernardo> When Emacs is started with strace ( $ strace emacs -Q ) it can be seen
Bernardo> that there are issues with the lock file that's created -
Bernardo> /media/sf_Home/.#zz_stuff
Bernardo> The strace messages are in the attachement.
Weʼre getting EPERM when doing unlink on the lock file, which is very
strange.
Bernardo> The 'shared directory' is a feature of Virtual Box which allows both the
Bernardo> host and applications running in a virtual machine to have access to
Bernardo> files in the same directory.
Bernardo> The file system type of the shared directory is vboxsf which seems to be
Bernardo> a layer on top of NTFS.
Bernardo> $ mount | grep vbox
Bernardo> Home on /media/sf_Home type vboxsf (rw,nodev,relatime,<snip>
Bernardo> It looks like symbolic links are not allowed on
Bernardo> this FS type; from terminal:
Bernardo> $ ln -s zz_stuff my_link
Bernardo> ln: failed to create symbolic link 'my_link': Operation not permitted
Right, so emacs switches to a regular file instead:
symlink fails:
symlink("mk7@deb.2246:1571819801", "/media/sf_Home/.#zz_stuff") = -1 EPERM (Operation not permitted)
so use a regular file:
open("/media/sf_Home/.#-emacsvxLcB2", O_RDWR|O_CREAT|O_EXCL|O_CLOEXEC, 0600) = 13
and put the lock information inside the file, and make it read-only:
write(13, "mk7@deb.2246:1571819801", 23) = 23
fchmod(13, 0444) = 0
and then rename it:
"/media/sf_Home/.#zz_stuff", RENAME_NOREPLACE) = 0
Later on when emacs saves the file, it tries to get rid of the lock
file, which fails:
unlink("/media/sf_Home/.#zz_stuff") = -1 EPERM (Operation not permitted)
So your filesystem doesnʼt let you call unlink() on read-only files? I
guess we could try adjusting the chmod to 664 or similar if that helps here.
Robert
next prev parent reply other threads:[~2019-10-24 16:10 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-23 10:28 bug#37884: 27.0.50; Cannot write to a file in VirtualBox shared directory Bernardo
2019-10-24 16:10 ` Robert Pluim [this message]
[not found] ` <87blu2emi3.fsf@pobox.com>
2019-10-27 15:34 ` Robert Pluim
2019-10-27 15:52 ` Eli Zaretskii
2019-10-27 16:01 ` Robert Pluim
2019-10-27 16:34 ` Eli Zaretskii
2019-10-28 9:23 ` Bernardo
2019-10-28 12:32 ` Robert Pluim
2019-10-29 8:50 ` Bernardo
2019-10-29 9:04 ` Andreas Schwab
2019-10-29 13:41 ` Robert Pluim
2019-10-30 8:44 ` Bernardo
2019-10-30 13:31 ` Robert Pluim
2019-10-30 16:25 ` Eli Zaretskii
2019-10-31 1:41 ` Paul Eggert
2019-10-31 7:38 ` Robert Pluim
2019-10-31 14:37 ` Eli Zaretskii
2019-10-31 21:24 ` Paul Eggert
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m2zhhqqjeg.fsf@gmail.com \
--to=rpluim@gmail.com \
--cc=37884@debbugs.gnu.org \
--cc=bernardo.bacic@pobox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).