From 88346b4aaf17c120783708196251f04cbd9d7c94 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Sun, 13 Jan 2019 21:39:34 +0000 Subject: [PATCH] Merge r7891 and r7892 from trunk git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/3.3.x@7893 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/include/backport.h | 2 +- scst/src/scst_lib.c | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/scst/include/backport.h b/scst/include/backport.h index 3348bd080..ca0d60682 100644 --- a/scst/include/backport.h +++ b/scst/include/backport.h @@ -449,7 +449,7 @@ kernel_read_backport(struct file *file, void *buf, size_t count, loff_t *pos) * See also commit 7bb307e894d5 ("export kernel_write(), convert open-coded * instances") # v3.10. */ -#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0) && !defined(RHEL_MAJOR) static inline ssize_t kernel_write_backport(struct file *file, void *buf, size_t count, loff_t *pos) { diff --git a/scst/src/scst_lib.c b/scst/src/scst_lib.c index 85351c44f..f3215cd5d 100644 --- a/scst/src/scst_lib.c +++ b/scst/src/scst_lib.c @@ -5853,6 +5853,8 @@ ssize_t scst_read(struct file *file, void *buf, size_t count, loff_t *pos) return scst_readv(file, &iov, 1, pos); #else + WARN_ON_ONCE(scst_cmp_fs_ds() != 0); + return vfs_read(file, (void __force __user *)buf, count, pos); #endif } @@ -5869,6 +5871,8 @@ ssize_t scst_write(struct file *file, const void *buf, size_t count, return scst_writev(file, &iov, 1, pos); #else + WARN_ON_ONCE(scst_cmp_fs_ds() != 0); + return vfs_write(file, (void __force __user *)buf, count, pos); #endif } @@ -5893,8 +5897,12 @@ ssize_t scst_readv(struct file *file, const struct iovec *vec, #elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0) || \ (defined(CONFIG_SUSE_KERNEL) && \ LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 0)) + WARN_ON_ONCE(scst_cmp_fs_ds() != 0); + return vfs_readv(file, (const struct iovec __user *)vec, vlen, pos, 0); #else + WARN_ON_ONCE(scst_cmp_fs_ds() != 0); + return vfs_readv(file, (const struct iovec __user *)vec, vlen, pos); #endif }