diff -Nru virtualbox-4.1.12-dfsg/debian/changelog virtualbox-4.1.12-dfsg/debian/changelog --- virtualbox-4.1.12-dfsg/debian/changelog 2013-09-10 11:50:23.000000000 +0000 +++ virtualbox-4.1.12-dfsg/debian/changelog 2013-09-30 08:55:24.000000000 +0000 @@ -1,3 +1,10 @@ +virtualbox (4.1.12-dfsg-2ubuntu0.5) precise-proposed; urgency=low + + * Update the patch for Linux 3.11 with a more complete + implementation (LP: #1076603). + + -- Alberto Milone Mon, 30 Sep 2013 10:54:27 +0200 + virtualbox (4.1.12-dfsg-2ubuntu0.4) precise-proposed; urgency=low * Add support for kernels up to 3.11 (LP: #1076603). diff -Nru virtualbox-4.1.12-dfsg/debian/patches/45-add-support-for-linux-3-11.patch virtualbox-4.1.12-dfsg/debian/patches/45-add-support-for-linux-3-11.patch --- virtualbox-4.1.12-dfsg/debian/patches/45-add-support-for-linux-3-11.patch 2013-09-10 11:26:22.000000000 +0000 +++ virtualbox-4.1.12-dfsg/debian/patches/45-add-support-for-linux-3-11.patch 2013-09-30 08:54:01.000000000 +0000 @@ -1,28 +1,89 @@ -From e42385a31d5833a03dfacd92a53fbc2d4ed1eaab Mon Sep 17 00:00:00 2001 -From: Alberto Milone -Date: Tue, 10 Sep 2013 13:25:47 +0200 -Subject: [PATCH 1/1] Add support for Linux 3.11 +Description: Fix for Linux 3.11 +Origin: upstream, https://www.virtualbox.org/changeset/47588/vbox and + https://www.virtualbox.org/changeset/47484/vbox ---- - src/VBox/Additions/linux/sharedfolders/dirops.c | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/src/VBox/Additions/linux/sharedfolders/dirops.c b/src/VBox/Additions/linux/sharedfolders/dirops.c -index 4a8144b..82151ae 100644 --- a/src/VBox/Additions/linux/sharedfolders/dirops.c +++ b/src/VBox/Additions/linux/sharedfolders/dirops.c -@@ -289,7 +289,11 @@ static int sf_dir_read (struct file *dir, void *opaque, filldir_t filldir) +@@ -233,7 +233,11 @@ + * b. failure to compute fake inode number + * c. filldir returns an error (see comment on that) + */ +-static int sf_dir_read (struct file *dir, void *opaque, filldir_t filldir) ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0) ++static int sf_dir_iterate(struct file *dir, struct dir_context *ctx) ++#else ++static int sf_dir_read(struct file *dir, void *opaque, filldir_t filldir) ++#endif + { + TRACE(); + for (;;) +@@ -257,12 +261,19 @@ + /* skip erroneous entry and proceed */ + LogFunc(("sf_getdent error %d\n", err)); + dir->f_pos += 1; ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0) ++ ctx->pos += 1; ++#endif + continue; + } + + /* d_name now contains a valid entry name */ + ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0) ++ sanity = ctx->pos + 0xbeef; ++#else + sanity = dir->f_pos + 0xbeef; ++#endif + fake_ino = sanity; + if (sanity - fake_ino) + { +@@ -270,8 +281,11 @@ + return -EINVAL; + } + +- err = filldir(opaque, d_name, strlen(d_name), +- dir->f_pos, fake_ino, DT_UNKNOWN); ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0) ++ err = dir_emit(ctx, d_name, strlen(d_name), fake_ino, DT_UNKNOWN); ++#else ++ err = filldir(opaque, d_name, strlen(d_name), dir->f_pos, fake_ino, DT_UNKNOWN); ++#endif + if (err) + { + LogFunc(("filldir returned error %d\n", err)); +@@ -281,6 +295,9 @@ + } + + dir->f_pos += 1; ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0) ++ ctx->pos += 1; ++#endif + } + + BUG(); +@@ -289,7 +306,11 @@ struct file_operations sf_dir_fops = { .open = sf_dir_open, -+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 11, 0) - .readdir = sf_dir_read, ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0) ++ .iterate = sf_dir_iterate, +#else -+ .iterate = sf_dir_read, + .readdir = sf_dir_read, +#endif .release = sf_dir_release, .read = generic_read_dir #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37) --- -1.7.9.5 - +--- a/src/VBox/HostDrivers/VBoxNetFlt/linux/VBoxNetFlt-linux.c ++++ b/src/VBox/HostDrivers/VBoxNetFlt/linux/VBoxNetFlt-linux.c +@@ -1804,7 +1804,11 @@ + + { + PVBOXNETFLTINS pThis = VBOX_FLT_NB_TO_INST(self); ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0) ++ struct net_device *pDev = netdev_notifier_info_to_dev(ptr); ++#else + struct net_device *pDev = (struct net_device *)ptr; ++#endif + int rc = NOTIFY_OK; + + Log(("VBoxNetFlt: got event %s(0x%lx) on %s, pDev=%p pThis=%p pThis->u.s.pDev=%p\n",