linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/4] vboxsf: Add support for the atomic_open directory-inode op
@ 2021-01-21 15:05 Hans de Goede
  2021-01-21 15:05 ` [PATCH v2 1/4] vboxsf: Honor excl flag to the dir-inode create op Hans de Goede
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Hans de Goede @ 2021-01-21 15:05 UTC (permalink / raw)
  To: Alexander Viro
  Cc: Hans de Goede, Christoph Hellwig, linux-fsdevel, Ludovic Pouzenc

Hi All,

Sorry for the v2 so quickly after the v1, I just got an ack from the
original reporter of the problem to add their Reported-by:

Reported-by: Ludovic Pouzenc <bugreports@pouzenc.fr>

No other changes, here is the v1 cover-letter again:

Opening a new file is done in 2 steps on regular filesystems:

1. Call the create inode-op on the parent-dir to create an inode
to hold the meta-data related to the file.
2. Call the open file-op to get a handle for the file.

vboxsf however does not really use disk-backed inodes because it
is based on passing through file-related system-calls through to
the hypervisor. So both steps translate to an open(2) call being
passed through to the hypervisor. With the handle returned by
the first call immediately being closed again.

Making 2 open calls for a single open(..., O_CREATE, ...) calls
has 2 problems:

a) It is not really efficient.
b) It actually breaks some apps.

An example of b) is doing a git clone inside a vboxsf mount.
When git clone tries to create a tempfile to store the pak
files which is downloading the following happens:

1. vboxsf_dir_mkfile() gets called with a mode of 0444 and succeeds.
2. vboxsf_file_open() gets called with file->f_flags containing
O_RDWR. When the host is a Linux machine this fails because doing
a open(..., O_RDWR) on a file which exists and has mode 0444 results
in an -EPERM error.

This series fixes this by adding support for the atomic_open
directory-inode op.

Hans de Goede (4):
  vboxsf: Honor excl flag to the dir-inode create op
  vboxsf: Make vboxsf_dir_create() return the handle for the created
    file
  vboxsf: Add vboxsf_[create|release]_sf_handle() helpers
  vboxsf: Add support for the atomic_open directory-inode op

 fs/vboxsf/dir.c    | 76 +++++++++++++++++++++++++++++++++++++++-------
 fs/vboxsf/file.c   | 71 +++++++++++++++++++++++++++----------------
 fs/vboxsf/vfsmod.h |  7 +++++
 3 files changed, 116 insertions(+), 38 deletions(-)

Regards,

Hans


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-01-21 15:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-01-21 15:05 [PATCH v2 0/4] vboxsf: Add support for the atomic_open directory-inode op Hans de Goede
2021-01-21 15:05 ` [PATCH v2 1/4] vboxsf: Honor excl flag to the dir-inode create op Hans de Goede
2021-01-21 15:05 ` [PATCH v2 2/4] vboxsf: Make vboxsf_dir_create() return the handle for the created file Hans de Goede
2021-01-21 15:05 ` [PATCH v2 3/4] vboxsf: Add vboxsf_[create|release]_sf_handle() helpers Hans de Goede
2021-01-21 15:05 ` [PATCH v2 4/4] vboxsf: Add support for the atomic_open directory-inode op Hans de Goede

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 NNTP newsgroup(s).