Skip to contentSkip to conversation

fs: Add VirtualBox guest shared folder (vboxsf) support

PATCH Superseded Hans de Goede 2 participants 7 messages Aug 15, 2019 – Aug 16, 2019

Subsystems (2)

v13 of 19 Superseded Latest is v19 →

lore
Share & tools
lore
#0 lore raw

PATCH v13 1/1 fs: Add VirtualBox guest shared folder (vboxsf) support

Hello Everyone,

Here is the 13th version of my cleaned-up / refactored version of the VirtualBox shared-folder VFS driver.

This version hopefully addresses all issues pointed out in Christoph's review of v12 (thank you for the review Christoph):

Changes in v13:
- Add SPDX tag to Makefile, use foo-y := to set objectfile list
- Drop kerneldoc headers stating the obvious from vfs callbacks, to avoid them going stale
- Replace sf_ prefix of functions and data-types with vboxsf_
- Use more normal naming scheme for sbi and private inode data:

    struct vboxsf_sbi *sbi = VBOXSF_SBI(inode->i_sb);
    struct vboxsf_inode *sf_i = VBOXSF_I(inode);

- Refactor directory reading code
- Use goto based unwinding instead of nested if-s in a number of places
- Consolidate dir unlink and rmdir inode_operations into a single function
- Use the page-cache for regular reads/writes too
- Directly set super_operations.free_inode to what used to be our vboxsf_i_callback, instead of setting super_operations.destroy_inode to a function which just does: call_rcu(&inode->i_rcu, vboxsf_i_callback);
- Use spinlock_irqsafe for ino_idr_lock
vboxsf_free_inode may be called from a RCU callback, and thus from softirq context, so we need to use spinlock_irqsafe vboxsf_new_inode. On alloc_inode failure vboxsf_free_inode may be called from process context, so it too needs to use spinlock_irqsafe.

This version has been used by several distributions (arch, Fedora) for a while now, so hopefully we can get this upstream soonish, please review.

Regards,

Hans

---

Full changelog:

Changes in v13:
- Add SPDX tag to Makefile, use foo-y := to set objectfile list
- Drop kerneldoc headers stating the obvious from vfs callbacks, to avoid them going stale
- Replace sf_ prefix of functions and data-types with vboxsf_
- Use more normal naming scheme for sbi and private inode data:

    struct vboxsf_sbi *sbi = VBOXSF_SBI(inode->i_sb);
    struct vboxsf_inode *sf_i = VBOXSF_I(inode);

- Refactor directory reading code
- Use goto based unwinding instead of nested if-s in a number of places
- Consolidate dir unlink and rmdir inode_operations into a single function
- Use the page-cache for regular reads/writes too
- Directly set super_operations.free_inode to what used to be our vboxsf_i_callback, instead of setting super_operations.destroy_inode to a function which just does: call_rcu(&inode->i_rcu, vboxsf_i_callback);
- Use spinlock_irqsafe for ino_idr_lock
vboxsf_free_inode may be called from a RCU callback, and thus from softirq context, so we need to use spinlock_irqsafe vboxsf_new_inode. On alloc_inode failure vboxsf_free_inode may be called from process context, so it too needs to use spinlock_irqsafe.

Changes in v12:
-Move make_kuid / make_kgid calls to option parsing time and add
uid_valid / gid_valid checks.
-In init_fs_context call current_uid_gid() to init uid and gid -Validate dmode, fmode, dmask and fmask options during option parsing -Use correct types for various mount option variables (kuid_t, kgid_t, umode_t) -Some small coding-style tweaks

Changes in v11:
-Convert to the new Documentation/filesystems/mount_api.txt mount API -Fixed all the function kerneldoc comments to have things in the proper order -Change type of d_type variable passed as type to dir_emit from int to
unsigned int
-Replaced the fake-ino overflow test with the one suggested by David Howells -Fixed various coding style issues

Changes in v10:
-Code-style fixes and remove some unneeded checks as suggested by Al Viro -Stop handle reuse between sf_create_aux and sf_reg_open, the code for this
was racy and the re-use meant the O_APPEND was not passed to the host for newly created files with O_APPEND set
-Use idr to generate unique inode number, modelled after the kernfs code -Only read and write the contents of the passed in offset pointer once in
sf_reg_write
-Keep a list of refcounted open handles in the inode, so that writepage can
get a writeable handle this way. This replaces the old very racy code which was just storing a pointer to the last opened struct file inside the inode. This is modelled after how the cifs and fuse code do this

Changes in v9:
-Change license from GPL-2.0 or CDDL-1.0 to MIT, following upstream's
license change from: https://www.virtualbox.org/changeset/72627/vbox
I've gotten permission by email from VirtualBox upstream to retro-actively apply the license-change to my "fork" of the vboxsf code
-Fix not being able to mount any shared-folders when built with gcc9 -Adjust for recent vboxguest changes
-Fix potential buffer overrun in vboxsf_nlscpy
-Fix build errors in some configs, caught by buildbot
-Fix 3 sparse warnings
-Some changes from upstream VirtualBox svn:
-Use 0x786f4256 /* 'VBox' little endian */ as super-magic matching upstream -Implement AT_STATX_SYNC_TYPE support
-Properly return -EPERM when symlink creation is not supported

Changes in v8:
-Fix broken error-handling / oops when the vboxsf_map_folder() call fails -Fix umount using umount.nfs to umount vboxsf mounts
-Prefixed the modules init and exit function names with vboxsf_ -Delay connecting to the vbox hypervisor until the first mount, this fixes
vboxsf not working when it is builtin (in which case it may be initialized before the vboxguest driver has bound to the guest communication PCI device)
-Fix sf_write_end return value, return the number of bytes written or 0 on error:
https://github.com/jwrdegoede/vboxsf/issues/2
-Use an ida id in the name passed to super_setup_bdi_name so that the same
shared-folder can be mounted twice without causing a
"sysfs: cannot create duplicate filename" error
https://github.com/jwrdegoede/vboxsf/issues/3

Changes in v7:
-Do not propagate sgid / suid bits between guest-host, note hosts with
VirtualBox version 5.2.6 or newer will filter these out regardless of what we do
-Better error messages when we cannot connect to the VirtualBox guest PCI
device, which may e.g. happen when trying to use vboxsf outside a vbox vm

Changes in v6:
-Address: https://www.virtualbox.org/ticket/819 which really is multiple bugs:
1) Fix MAP_SHARED not being supported
2) Fix changes done through regular read/write on the guest side not being seen by guest apps using mmap() access
3) Fix any changes done on the host side not being seen by guest apps using mmap() access

Changes in v5:
-Honor CONFIG_NLS_DEFAULT (reported-by [email protected])

Changes in v4:
-Drop "name=..." mount option, instead use the dev_name argument to the
mount syscall, to keep compatibility with existing fstab entries
-Fix "nls=%" match_table_t entry to "nls=%s"

Changes in v3:
-Use text only mount options, instead of a custom data struct -Stop caching full path in inode data, if parents gets renamed it will change -Fixed negative dentries handling
-Dropped the force_reread flag for dirs, not sure what it was actually for
but it is no good, doing a re-read on unlink of a file will lead to another file being skipped if the caller has already iterated over the entry for the unlinked file.
-Use file_inode(), file_dentry() and d_inode() helpers
-Prefix any non object-private symbols with vboxsf_ so as to not pollute
the global namespace when builtin
-Add MAINTAINERS entry
-Misc. cleanups

Changes in v2:
-Removed various unused wrapper functions
-Don't use i_private, instead defined alloc_inode and destroy_inode
methods and use container_of.
-Drop obsolete comment referencing people to
http://www.atnf.csiro.au/people/rgooch/linux/vfs.txt
-move the single symlink op of from lnkops.c to file.c
-Use SPDX license headers
-Replace SHFLROOT / SHFLHANDLE defines with normal types -Removed unnecessary S_ISREG checks
-Got rid of bounce_buffer in regops, instead add a "user" flag to
vboxsf_read / vboxsf_write, re-using the existing __user address support in the vboxguest module
-Make vboxsf_wrappers return regular linux errno values
-Use i_size_write to update size on writing
-Convert doxygen style comments to kerneldoc style comments

#1 lore raw

PATCH v13 1/1 fs: Add VirtualBox guest shared folder (vboxsf) support

VirtualBox hosts can share folders with guests, this commit adds a VFS driver implementing the Linux-guest side of this, allowing folders exported by the host to be mounted under Linux.

This driver depends on the guest <-> host IPC functions exported by the vboxguest driver.

---
Changes in v13
- Add SPDX tag to Makefile, use foo-y := to set objectfile list
- Drop kerneldoc headers stating the obvious from vfs callbacks, to avoid them going stale
- Replace sf_ prefix of functions and data-types with vboxsf_
- Use more normal naming scheme for sbi and private inode data:

    struct vboxsf_sbi *sbi = VBOXSF_SBI(inode->i_sb);
    struct vboxsf_inode *sf_i = VBOXSF_I(inode);

- Refactor directory reading code
- Use goto based unwinding instead of nested if-s in a number of places
- Consolidate dir unlink and rmdir inode_operations into a single function
- Use the page-cache for regular reads/writes too
- Directly set super_operations.free_inode to what used to be our vboxsf_i_callback, instead of setting super_operations.destroy_inode to a function which just does: call_rcu(&inode->i_rcu, vboxsf_i_callback);
- Use spinlock_irqsafe for ino_idr_lock
vboxsf_free_inode may be called from a RCU callback, and thus from softirq context, so we need to use spinlock_irqsafe vboxsf_new_inode. On alloc_inode failure vboxsf_free_inode may be called from process context, so it too needs to use spinlock_irqsafe.

Changes in v12:
- Move make_kuid / make_kgid calls to option parsing time and add uid_valid / gid_valid checks.
- In init_fs_context call current_uid_gid() to init uid and gid
- Validate dmode, fmode, dmask and fmask options during option parsing
- Use correct types for various mount option variables (kuid_t, kgid_t, umode_t)
- Some small coding-style tweaks

Changes in v11:
- Convert to the new Documentation/filesystems/mount_api.txt mount API
- Fixed all the function kerneldoc comments to have things in the proper order
- Change type of d_type variable passed as type to dir_emit from int to unsigned int
- Replaced the fake-ino overflow test with the one suggested by David Howells
- Fixed various coding style issues

See cover-letter for full changelog including older versions

---
 MAINTAINERS                 |   6 +
 fs/Kconfig                  |   1 +
 fs/Makefile                 |   1 +
 fs/vboxsf/Kconfig           |  10 +
 fs/vboxsf/Makefile          |   5 +
 fs/vboxsf/dir.c             | 420 +++++++++++++++++
 fs/vboxsf/file.c            | 358 ++++++++++++++
 fs/vboxsf/shfl_hostintf.h   | 901 ++++++++++++++++++++++++++++++++++++
 fs/vboxsf/super.c           | 493 ++++++++++++++++++++
 fs/vboxsf/utils.c           | 550 ++++++++++++++++++++++
 fs/vboxsf/vboxsf_wrappers.c | 371 +++++++++++++++
 fs/vboxsf/vfsmod.h          | 137 ++++++
 12 files changed, 3253 insertions(+)
 create mode 100644 fs/vboxsf/Kconfig
 create mode 100644 fs/vboxsf/Makefile
 create mode 100644 fs/vboxsf/dir.c
 create mode 100644 fs/vboxsf/file.c
 create mode 100644 fs/vboxsf/shfl_hostintf.h
 create mode 100644 fs/vboxsf/super.c
 create mode 100644 fs/vboxsf/utils.c
 create mode 100644 fs/vboxsf/vboxsf_wrappers.c
 create mode 100644 fs/vboxsf/vfsmod.h
MAINTAINERS +6 -0
index 506bb2411dd9..aafb605205e6 100644
@@ -17158,6 +17158,12 @@ F:	include/linux/vbox_utils.h
 F:	include/uapi/linux/vbox*.h
 F:	drivers/virt/vboxguest/
 
+VIRTUAL BOX SHARED FOLDER VFS DRIVER:
+M:	Hans de Goede <[email protected]>
+L:	[email protected]
+S:	Maintained
+F:	fs/vboxsf/*
+
 VIRTUAL SERIO DEVICE DRIVER
 M:	Stephen Chandler Paul <[email protected]>
 S:	Maintained
fs/Kconfig +1 -0
index bfb1c6095c7a..65afdda5b8f8 100644
@@ -261,6 +261,7 @@ source "fs/romfs/Kconfig"
 source "fs/pstore/Kconfig"
 source "fs/sysv/Kconfig"
 source "fs/ufs/Kconfig"
+source "fs/vboxsf/Kconfig"
 
 endif # MISC_FILESYSTEMS
 
fs/Makefile +1 -0
index d60089fd689b..1ff5782a2037 100644
@@ -130,3 +130,4 @@ obj-$(CONFIG_F2FS_FS)		+= f2fs/
 obj-$(CONFIG_CEPH_FS)		+= ceph/
 obj-$(CONFIG_PSTORE)		+= pstore/
 obj-$(CONFIG_EFIVAR_FS)		+= efivarfs/
+obj-$(CONFIG_VBOXSF_FS)		+= vboxsf/
fs/vboxsf/Kconfig new file +10 -0
new file mode 100644
index 000000000000..b84586ae08b3
@@ -0,0 +1,10 @@
+config VBOXSF_FS
+	tristate "VirtualBox guest shared folder (vboxsf) support"
+	depends on X86 && VBOXGUEST
+	select NLS
+	help
+	  VirtualBox hosts can share folders with guests, this driver
+	  implements the Linux-guest side of this allowing folders exported
+	  by the host to be mounted under Linux.
+
+	  If you want to use shared folders in VirtualBox guests, answer Y or M.
fs/vboxsf/Makefile new file +5 -0
new file mode 100644
index 000000000000..9e4328e79623
@@ -0,0 +1,5 @@
+# SPDX-License-Identifier: MIT
+
+obj-$(CONFIG_VBOXSF_FS) += vboxsf.o
+
+vboxsf-y := dir.o file.o utils.o vboxsf_wrappers.o super.o
fs/vboxsf/dir.c new file +420 -0

420 lines not on this page · raw message

fs/vboxsf/file.c new file +358 -0

358 lines not on this page · raw message

fs/vboxsf/shfl_hostintf.h new file +901 -0

901 lines not on this page · raw message

fs/vboxsf/super.c new file +493 -0

493 lines not on this page · raw message

fs/vboxsf/utils.c new file +550 -0

550 lines not on this page · raw message

fs/vboxsf/vboxsf_wrappers.c new file +371 -0

240 lines not on this page · raw message

fs/vboxsf/vfsmod.h new file +137 -0

137 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.23.0.rc2

Part of the diff is not shown here. View the raw message.

#2 lore raw

A couple minor comments. Otherwise we should be fine, things aren't going to get much better for such a messed up protocol design.

fs/vboxsf/dir.c line 160

Quoted 9 lines
fs/vboxsf/dir.c new file +9 -0
+			return dir_emit(ctx, d_name, strlen(d_name),
+					fake_ino, d_type);
+		} else {
+			return dir_emit(ctx,
+					info->name.string.utf8,
+					info->name.length,
+					fake_ino, d_type);
+		}
+	}

Nitpick: no need for an else after a return.

fs/vboxsf/file.c line 122

Quoted 6 lines
fs/vboxsf/file.c new file +6 -0
+static int vboxsf_file_release(struct inode *inode, struct file *file)
+{
+	struct vboxsf_inode *sf_i = VBOXSF_I(inode);
+	struct vboxsf_handle *sf_handle = file->private_data;
+
+	filemap_write_and_wait(inode->i_mapping);

Normal Linux semantics don't include writing back data on close, so if you are doing this to follow other things like NFS CTO semantics it should have a comment explaining that.

fs/vboxsf/file.c line 129

Quoted 7 lines
fs/vboxsf/file.c new file +7 -0
+
+	mutex_lock(&sf_i->handle_list_mutex);
+	list_del(&sf_handle->head);
+	mutex_unlock(&sf_i->handle_list_mutex);
+
+	kref_put(&sf_handle->refcount, vboxsf_handle_release);
+	file->private_data = NULL;

There is no need to zero ->private_data on release, the file gets freed and never reused.

Quoted 6 lines

+ * Ideally we would wrap generic_file_read_iter with a function which also
+ * does this check, to reduce the chance of us missing writes happening on the
+ * host side after open(). But the vboxsf stat call to the host only works on
+ * filenames, so that would require caching the filename in our
+ * file->private_data and there is no guarantee that filename will still
+ * be valid at read_iter time. So this would be in no way bulletproof.

Well, you can usually generate a file name from file->f_path.dentry. The only odd case is opened by unliked files. NFS has a special hack for those called sillyrename (you can grep for that). How similar to normal posix semantics are expected from this fs?

fs/vboxsf/file.c line 231

Quoted 6 lines
fs/vboxsf/file.c new file +6 -0
+
+	mutex_lock(&sf_i->handle_list_mutex);
+	list_for_each_entry(h, &sf_i->handle_list, head) {
+		if (h->access_flags == SHFL_CF_ACCESS_WRITE ||
+		    h->access_flags == SHFL_CF_ACCESS_READWRITE) {
+			kref_get(&h->refcount);

Does this need a kref_get_unless_zero to deal with races during list removal?

#3 lore raw

Hi,

Thank you once more more for the review and also for the quick turn-around time.

Quoted 14 lines · Christoph Hellwig

A couple minor comments. Otherwise we should be fine, things aren't going to get much better for such a messed up protocol design.

fs/vboxsf/dir.c line 160

Quoted 9 lines
fs/vboxsf/dir.c new file +9 -0
+			return dir_emit(ctx, d_name, strlen(d_name),
+					fake_ino, d_type);
+		} else {
+			return dir_emit(ctx,
+					info->name.string.utf8,
+					info->name.length,
+					fake_ino, d_type);
+		}
+	}

Nitpick: no need for an else after a return.

Fixed for the next version.

Quoted 10 lines

fs/vboxsf/file.c line 122

Quoted 6 lines
fs/vboxsf/file.c new file +6 -0
+static int vboxsf_file_release(struct inode *inode, struct file *file)
+{
+	struct vboxsf_inode *sf_i = VBOXSF_I(inode);
+	struct vboxsf_handle *sf_handle = file->private_data;
+
+	filemap_write_and_wait(inode->i_mapping);

Normal Linux semantics don't include writing back data on close, so if you are doing this to follow other things like NFS CTO semantics it should have a comment explaining that.

Ok, I've added the following comment for the next version:

        /*
         * When a file is closed on our (the guest) side, we want any subsequent
         * accesses done on the host side to see all changes done from our side.
         */
        filemap_write_and_wait(inode->i_mapping);
Quoted 10 lines

fs/vboxsf/file.c line 129

Quoted 7 lines
fs/vboxsf/file.c new file +7 -0
+
+	mutex_lock(&sf_i->handle_list_mutex);
+	list_del(&sf_handle->head);
+	mutex_unlock(&sf_i->handle_list_mutex);
+
+	kref_put(&sf_handle->refcount, vboxsf_handle_release);
+	file->private_data = NULL;

There is no need to zero ->private_data on release, the file gets freed and never reused.

Fixed for the next version.

Quoted 10 lines
Quoted 6 lines

+ * Ideally we would wrap generic_file_read_iter with a function which also
+ * does this check, to reduce the chance of us missing writes happening on the
+ * host side after open(). But the vboxsf stat call to the host only works on
+ * filenames, so that would require caching the filename in our
+ * file->private_data and there is no guarantee that filename will still
+ * be valid at read_iter time. So this would be in no way bulletproof.

Well, you can usually generate a file name from file->f_path.dentry. The only odd case is opened by unliked files. NFS has a special hack for those called sillyrename (you can grep for that).

Right, so since the unlink or a normal rename could happen on the host side and there is no notification of that, those will be 2 areas where a stat call to verify will fail, which leaves us with 3 options:

1) Make stat calls before read() calls, if they fail purge the cache to be safe
2) Make stat calls before read(), on failure ignore the stat call
3) Treat read() calls like other page-cache reads such as sendfile or mmap and only check if the cache is stale at open() time.

Quoted 1 line

How similar to normal posix semantics are expected from this fs?

Similar enough to have most apps work normally. Certainly we should make all accesses from the guest side be consistent with each other / have full posix semantics.

But mixing writes from both the host and guest side is something which the user IMHO should simply be careful with doing. Until I fixed it about a year ago there was a long standing bug upstream where users would edit web-pages on the host and then serve them from Apache on the guest. Apache would use sendfile, going through the pagecache and keep serving the old file. This is where the stale cache check in vboxsf_inode_revalidate() comes from I added that to fix this issue.

The out of tree version of vboxsf is in use for many years and they have gotten away without even the staleness check at open time() all that time. To be fair they did pass through read() calls directly to the host without going through the page-cache but that causes consistency issues for accesses from within the guest which are more important to get right IMHO, as there we can actually get things right.

TL;DR: I believe that the current approach which is 3. from above is good enough and I like that it is very KISS. We can always switch to
1. or 2. (or add 1. and 2. and make it configurable) later if this shows to be necessary.

Can you please let me know if option 3. / the KISS method is ok with you, or if you would prefer me to add code to do 1. or 2?

Once I have an answer on this I will post a new version.

Quoted 9 lines

fs/vboxsf/file.c line 231

Quoted 6 lines
fs/vboxsf/file.c new file +6 -0
+
+	mutex_lock(&sf_i->handle_list_mutex);
+	list_for_each_entry(h, &sf_i->handle_list, head) {
+		if (h->access_flags == SHFL_CF_ACCESS_WRITE ||
+		    h->access_flags == SHFL_CF_ACCESS_READWRITE) {
+			kref_get(&h->refcount);

Does this need a kref_get_unless_zero to deal with races during list removal?

List remove always happens with the handle_list_mutex held, so no that is not necessary.

Regards,

Hans

#4 lore raw

P.S.

Quoted 1 line · Hans de Goede

On 16-08-19 09:56, Christoph Hellwig wrote:

<snip>

Quoted 11 lines
Quoted 10 lines
Quoted 6 lines

+ * Ideally we would wrap generic_file_read_iter with a function which also
+ * does this check, to reduce the chance of us missing writes happening on the
+ * host side after open(). But the vboxsf stat call to the host only works on
+ * filenames, so that would require caching the filename in our
+ * file->private_data and there is no guarantee that filename will still
+ * be valid at read_iter time. So this would be in no way bulletproof.

Well, you can usually generate a file name from file->f_path.dentry. The only odd case is opened by unliked files.  NFS has a special hack for those called sillyrename (you can grep for that).

Quoted 8 lines

Right, so since the unlink or a normal rename could happen on the host side and there is no notification of that, those will be 2 areas where a stat call to verify will fail, which leaves us with 3 options:

1) Make stat calls before read() calls, if they fail purge the cache to be safe
2) Make stat calls before read(), on failure ignore the stat call
3) Treat read() calls like other page-cache reads such as sendfile or mmap and only check if the cache is stale at open() time.

I just realized there is a 4th option, which is to make vboxsf read_iter simply always do:

4) Always evict non dirt pages from page-cache from read_iter, to ensure we get the latest version from the host:

So something like this:

	/*
         * Evict non dirt pages from page-cache, so that we reget them from
         * the host in case they have been changed.
         * /
	invalidate_mapping_pages(inode->i_mapping, pos >> PAGE_SHIFT,
				 (pos + len) >> PAGE_SHIFT);
        generic_file_read_iter(...)

This is in essence what the out of tree driver is doing on read(), except that it does not go through the page-cache at all.

I think this might be the best option, perhaps controlled by a mount flag ?

Regards,

Hans

#5 lore raw
In reply to Hans de Goede
Quoted 7 lines · Hans de Goede

TL;DR: I believe that the current approach which is 3. from above is good enough and I like that it is very KISS. We can always switch to
1. or 2. (or add 1. and 2. and make it configurable) later if this shows to be necessary.

Can you please let me know if option 3. / the KISS method is ok with you, or if you would prefer me to add code to do 1. or 2?

I'm not sure I actually care. Reading through the code just made me realizie that no sane person should use this. Obviously there are plenty of insane people, otherwise virtualbox wouldn't be around anymore anyway, and they apparently lived with much worse bugs before.

What I do care about is that someone actually thought about these issues, which you very much did (probably unlike the original authors). Maybe explaining these choice in code comments in addition to the email would help, though.

#6 lore raw
In reply to Hans de Goede

Hi,

Quoted 29 lines · Hans de Goede

Hello Everyone,

Here is the 13th version of my cleaned-up / refactored version of the VirtualBox shared-folder VFS driver.

This version hopefully addresses all issues pointed out in Christoph's review of v12 (thank you for the review Christoph):

Changes in v13:
- Add SPDX tag to Makefile, use foo-y := to set objectfile list
- Drop kerneldoc headers stating the obvious from vfs callbacks, to avoid them going stale
- Replace sf_ prefix of functions and data-types with vboxsf_
- Use more normal naming scheme for sbi and private inode data:

     struct vboxsf_sbi *sbi = VBOXSF_SBI(inode->i_sb);
     struct vboxsf_inode *sf_i = VBOXSF_I(inode);

- Refactor directory reading code
- Use goto based unwinding instead of nested if-s in a number of places
- Consolidate dir unlink and rmdir inode_operations into a single function
- Use the page-cache for regular reads/writes too
- Directly set super_operations.free_inode to what used to be our vboxsf_i_callback, instead of setting super_operations.destroy_inode to a function which just does: call_rcu(&inode->i_rcu, vboxsf_i_callback);
- Use spinlock_irqsafe for ino_idr_lock
vboxsf_free_inode may be called from a RCU callback, and thus from softirq context, so we need to use spinlock_irqsafe vboxsf_new_inode. On alloc_inode failure vboxsf_free_inode may be called from process context, so it too needs to use spinlock_irqsafe.

Quoted 2 lines

This version has been used by several distributions (arch, Fedora) for a while now, so hopefully we can get this upstream soonish, please review.

I just noticed I forgot to add 0/1 to the subject of this cover letter, the second mail with the same subject (sorry) is the actual patch.

Regards,

Hans