scst: Fix the RHEL 6 / 7 kernel_write() backport

This patch unbreaks persistent reservation support.

Fixes: 94018a42e3 ("scst: Use kernel_{read,write}() instead of scst_{read,write}()")
Reported-by: Gleb Chesnokov <Chesnokov.G@raidix.com>


git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/3.4.x@9122 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Bart Van Assche
2020-08-28 04:20:11 +00:00
parent 63c7eec6b0
commit 1f4033e5e7

View File

@@ -496,7 +496,12 @@ kernel_write_backport(struct file *file, const void *buf, size_t count,
loff_t *pos)
{
#ifndef CONFIG_SUSE_KERNEL
return kernel_write(file, buf, count, *pos);
int res = kernel_write(file, buf, count, *pos);
if (res > 0)
*pos += res;
return res;
#else
return kernel_write(file, buf, count, pos);
#endif