mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-19 19:51:27 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user