summarylogtreecommitdiffstats
path: root/0001-fix-for-4.9.y.patch
diff options
context:
space:
mode:
Diffstat (limited to '0001-fix-for-4.9.y.patch')
-rw-r--r--0001-fix-for-4.9.y.patch136
1 files changed, 119 insertions, 17 deletions
diff --git a/0001-fix-for-4.9.y.patch b/0001-fix-for-4.9.y.patch
index 58df4eeacc33..799ca7533fdd 100644
--- a/0001-fix-for-4.9.y.patch
+++ b/0001-fix-for-4.9.y.patch
@@ -1,42 +1,48 @@
-From 8695b6d330e237f5e21bef576d0ba3e49832b6fe Mon Sep 17 00:00:00 2001
+From 7d99b6d8e78946e06f066c25145fe7cf93b7d5b4 Mon Sep 17 00:00:00 2001
From: Cody P Schafer <dev@codyps.com>
Date: Mon, 30 Jan 2017 12:22:26 -0500
Subject: [PATCH] fix for 4.9.y
---
- prl_fs/SharedFolders/Guest/Linux/prl_fs/inode.c | 12 ++++++++++++
- prl_tg/Toolgate/Guest/Linux/prl_tg/prltg.c | 2 +-
- prl_tg/Toolgate/Guest/Linux/prl_tg/prltg_compat.h | 10 ++++++++--
- 3 files changed, 21 insertions(+), 3 deletions(-)
+ prl_fs/SharedFolders/Guest/Linux/prl_fs/Makefile | 2 +-
+ prl_fs/SharedFolders/Guest/Linux/prl_fs/inode.c | 15 ++++++++++++++-
+ prl_fs/SharedFolders/Guest/Linux/prl_fs/interface.c | 6 ++++++
+ prl_fs/SharedFolders/Guest/Linux/prl_fs/prlfs.h | 3 ++-
+ prl_fs/SharedFolders/Guest/Linux/prl_fs/super.c | 8 ++++++--
+ prl_tg/Toolgate/Guest/Linux/prl_tg/Makefile | 2 +-
+ prl_tg/Toolgate/Guest/Linux/prl_tg/prltg.c | 5 +++--
+ prl_tg/Toolgate/Guest/Linux/prl_tg/prltg_compat.h | 10 ++++++++--
+ 8 files changed, 41 insertions(+), 10 deletions(-)
diff --git a/prl_fs/SharedFolders/Guest/Linux/prl_fs/inode.c b/prl_fs/SharedFolders/Guest/Linux/prl_fs/inode.c
-index 5502d70..e8d0043 100644
+index 5502d70..ccee80c 100644
--- a/prl_fs/SharedFolders/Guest/Linux/prl_fs/inode.c
+++ b/prl_fs/SharedFolders/Guest/Linux/prl_fs/inode.c
-@@ -382,11 +382,22 @@ static int prlfs_rmdir(struct inode *dir, struct dentry *dentry)
- return ret;
+@@ -383,10 +383,22 @@ static int prlfs_rmdir(struct inode *dir, struct dentry *dentry)
}
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,9,0)
static int prlfs_rename(struct inode *old_dir, struct dentry *old_de,
- struct inode *new_dir, struct dentry *new_de)
-+#else
-+static int prlfs_rename(struct inode *old_dir, struct dentry *old_de,
-+ struct inode *new_dir, struct dentry *new_de, unsigned int flags)
+- struct inode *new_dir, struct dentry *new_de)
++ struct inode *new_dir, struct dentry *new_de
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,9,0)
++ , unsigned int flags
+#endif
++ )
{
void *np, *nbuf;
int nbuflen;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,9,0)
-+ if (flags)
++ if (flags) {
++ pr_info_ratelimited("rename got invalid flags: 0x%x\n", flags);
+ return -EINVAL;
++ }
+#endif
+
+ {
PRLFS_STD_INODE_HEAD(old_de)
nbuflen = PATH_MAX;
nbuf = kmalloc(nbuflen, GFP_KERNEL);
-@@ -406,6 +417,7 @@ static int prlfs_rename(struct inode *old_dir, struct dentry *old_de,
+@@ -406,6 +418,7 @@ static int prlfs_rename(struct inode *old_dir, struct dentry *old_de,
out_free1:
kfree(nbuf);
PRLFS_STD_INODE_TAIL
@@ -44,11 +50,107 @@ index 5502d70..e8d0043 100644
}
/*
+diff --git a/prl_fs/SharedFolders/Guest/Linux/prl_fs/interface.c b/prl_fs/SharedFolders/Guest/Linux/prl_fs/interface.c
+index 1665ed3..89b809f 100644
+--- a/prl_fs/SharedFolders/Guest/Linux/prl_fs/interface.c
++++ b/prl_fs/SharedFolders/Guest/Linux/prl_fs/interface.c
+@@ -114,6 +114,9 @@ int host_request_get_sf_list(struct pci_dev *pdev, void *data, int size)
+ ret = call_tg_sync(pdev, &sdesc);
+ if ((ret == 0) && (Req.Req.Status != TG_STATUS_SUCCESS))
+ ret = -TG_ERR(Req.Req.Status);
++ if (ret < 0) {
++ pr_warn("failed to get sf list: %d\n", ret);
++ }
+ return ret;
+ }
+
+@@ -136,6 +139,9 @@ int host_request_sf_param(struct pci_dev *pdev, void *data, int size,
+ ret = call_tg_sync(pdev, &sdesc);
+ if ((ret == 0) && (Req.Req.Status != TG_STATUS_SUCCESS))
+ ret = -TG_ERR(Req.Req.Status);
++ if (ret < 0) {
++ pr_warn("sf_param failed: %d %d\n", ret, Req.Req.Status);
++ }
+ return ret;
+ }
+
+diff --git a/prl_fs/SharedFolders/Guest/Linux/prl_fs/prlfs.h b/prl_fs/SharedFolders/Guest/Linux/prl_fs/prlfs.h
+index 77660e0..c6d342a 100644
+--- a/prl_fs/SharedFolders/Guest/Linux/prl_fs/prlfs.h
++++ b/prl_fs/SharedFolders/Guest/Linux/prl_fs/prlfs.h
+@@ -149,13 +149,14 @@ int host_request_symlink(struct super_block *sb, const void *src_path, int src_l
+
+ /* define to 1 to enable copious debugging info */
+ #undef DRV_DEBUG
++#define DRV_DEBUG 1
+
+ /* define to 1 to disable lightweight runtime debugging checks */
+ #undef DRV_NDEBUG
+
+ #ifdef DRV_DEBUG
+ /* note: prints function name for you */
+-# define DPRINTK(fmt, args...) printk(KERN_DEBUG "%s: " fmt, __FUNCTION__ , ## args)
++# define DPRINTK(fmt, args...) pr_debug("%s: " fmt, __FUNCTION__ , ## args)
+ #else
+ # define DPRINTK(fmt, args...)
+ #endif
+diff --git a/prl_fs/SharedFolders/Guest/Linux/prl_fs/super.c b/prl_fs/SharedFolders/Guest/Linux/prl_fs/super.c
+index 5b7e5e8..2aae4ce 100644
+--- a/prl_fs/SharedFolders/Guest/Linux/prl_fs/super.c
++++ b/prl_fs/SharedFolders/Guest/Linux/prl_fs/super.c
+@@ -441,12 +441,16 @@ static int seq_sf_show(struct seq_file *s, void *v)
+ psp.id = GET_SF_INFO;
+ strncpy((char *)&psp.locale, "utf-8", LOCALE_NAME_LEN - 1);
+ ret = host_request_sf_param(tg_dev, p, PAGE_SIZE, &psp);
+- if (ret < 0)
++ if (ret < 0) {
++ pr_warn("could not get info for %u: %d\n", psp.index, ret);
+ goto free;
++ }
+
+ prsp = p;
+- if (prsp->ret == 0)
++ if (prsp->ret == 0) {
++ pr_warn("empty info for %u\n", psp.index);
+ goto free;
++ }
+
+ *((char *)prsp + PAGE_SIZE - 1) = 0;
+ seq_printf(s, "%x: %s ", psp.index, prsp->buf);
+diff --git a/prl_tg/Toolgate/Guest/Linux/prl_tg/Makefile b/prl_tg/Toolgate/Guest/Linux/prl_tg/Makefile
+index 014ae08..9af5c16 100644
+--- a/prl_tg/Toolgate/Guest/Linux/prl_tg/Makefile
++++ b/prl_tg/Toolgate/Guest/Linux/prl_tg/Makefile
+@@ -21,7 +21,7 @@ DRIVER_DIR ?= $(PWD)
+
+ export DRIVER_DIR
+
+-EXTRA_CFLAGS += -I$(DRIVER_DIR)
++EXTRA_CFLAGS += -I$(DRIVER_DIR) -DDEBUG=1
+ EXTRA_CFLAGS += -I$(DRIVER_DIR)/../../../../
+
+ # Get version from version.h in kernel source directory
diff --git a/prl_tg/Toolgate/Guest/Linux/prl_tg/prltg.c b/prl_tg/Toolgate/Guest/Linux/prl_tg/prltg.c
-index a03e742..9f54ec1 100644
+index a03e742..a48862d 100644
--- a/prl_tg/Toolgate/Guest/Linux/prl_tg/prltg.c
+++ b/prl_tg/Toolgate/Guest/Linux/prl_tg/prltg.c
-@@ -480,7 +480,7 @@ static TG_PAGED_BUFFER *map_user_request(TG_PAGED_BUFFER *buf, TG_BUFFER *sbuf,
+@@ -42,13 +42,14 @@ static char version[] = KERN_INFO DRIVER_LOAD_MSG "\n";
+
+ /* define to 1 to enable copious debugging info */
+ #undef DRV_DEBUG
++#define DRV_DEBUG 1
+
+ /* define to 1 to disable lightweight runtime debugging checks */
+ #undef DRV_NDEBUG
+
+ #ifdef DRV_DEBUG
+ /* note: prints function name for you */
+-# define DPRINTK(fmt, args...) printk(KERN_DEBUG "%s: " fmt, __FUNCTION__ , ## args)
++# define DPRINTK(fmt, args...) pr_debug("%s: " fmt, __FUNCTION__ , ## args)
+ #else
+ # define DPRINTK(fmt, args...)
+ #endif
+@@ -480,7 +481,7 @@ static TG_PAGED_BUFFER *map_user_request(TG_PAGED_BUFFER *buf, TG_BUFFER *sbuf,
/* lock userspace pages */
got = get_user_pages(
sbuf->u.Va, npages,