master: add checking unsupported kernel versions 4.7..4.14 49/170149/5
authorVyacheslav Cherkashin <v.cherkashin@samsung.com>
Tue, 13 Feb 2018 17:23:18 +0000 (20:23 +0300)
committerVyacheslav Cherkashin <v.cherkashin@samsung.com>
Thu, 15 Feb 2018 14:58:52 +0000 (17:58 +0300)
Global rcu-lock(debugfs_srcu) was added to debugfs
in commit to linux-kernel:9fd4dcece43.
It causes deadlock in debugfs_remove_recursive().

Change-Id: Ie26901cfe52029a8f930e61333d46f93dff74fda
Signed-off-by: Vyacheslav Cherkashin <v.cherkashin@samsung.com>
modules/master/swap_debugfs.c

index 661305b707a647a812a2a4746cf50aaa4510755d..f4370162dc659621e72027facd9e6c65fe723c3b 100644 (file)
@@ -20,6 +20,9 @@
  */
 
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
+
 #include <linux/module.h>
 #include <linux/debugfs.h>
 #include <linux/uaccess.h>
@@ -293,6 +296,16 @@ static ssize_t write_enable(struct file *file, const char __user *user_buf,
        char buf[32];
        size_t buf_size;
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0) && LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
+       /*
+        * Global rcu-lock(debugfs_srcu) was added to debugfs
+        * in commit to linux-kernel:9fd4dcece43.
+        * It causes deadlock in debugfs_remove_recursive().
+        */
+       pr_err("This kernel version does not supported\n");
+       return -EPERM;
+#endif
+
        buf_size = min(count, (sizeof(buf) - 1));
        if (copy_from_user(buf, user_buf, buf_size))
                return -EFAULT;