提交 166fed5d 编写于 作者: A Al Viro 提交者: zhaoxiaoqiang11

WRITE is "data source", not destination...

stable inclusion
from stable-v5.10.168
commit fefb47a8331c55d3e981b7e34485c31eb50c2a14
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I7URR4

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=fefb47a8331c55d3e981b7e34485c31eb50c2a14

----------------------------------------------------

[ Upstream commit 974c36fb ]
Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: Nzhaoxiaoqiang11 <zhaoxiaoqiang11@jd.com>
上级 fee54fcf
...@@ -640,7 +640,7 @@ static void sbefifo_collect_async_ffdc(struct sbefifo *sbefifo) ...@@ -640,7 +640,7 @@ static void sbefifo_collect_async_ffdc(struct sbefifo *sbefifo)
} }
ffdc_iov.iov_base = ffdc; ffdc_iov.iov_base = ffdc;
ffdc_iov.iov_len = SBEFIFO_MAX_FFDC_SIZE; ffdc_iov.iov_len = SBEFIFO_MAX_FFDC_SIZE;
iov_iter_kvec(&ffdc_iter, WRITE, &ffdc_iov, 1, SBEFIFO_MAX_FFDC_SIZE); iov_iter_kvec(&ffdc_iter, READ, &ffdc_iov, 1, SBEFIFO_MAX_FFDC_SIZE);
cmd[0] = cpu_to_be32(2); cmd[0] = cpu_to_be32(2);
cmd[1] = cpu_to_be32(SBEFIFO_CMD_GET_SBE_FFDC); cmd[1] = cpu_to_be32(SBEFIFO_CMD_GET_SBE_FFDC);
rc = sbefifo_do_command(sbefifo, cmd, 2, &ffdc_iter); rc = sbefifo_do_command(sbefifo, cmd, 2, &ffdc_iter);
...@@ -737,7 +737,7 @@ int sbefifo_submit(struct device *dev, const __be32 *command, size_t cmd_len, ...@@ -737,7 +737,7 @@ int sbefifo_submit(struct device *dev, const __be32 *command, size_t cmd_len,
rbytes = (*resp_len) * sizeof(__be32); rbytes = (*resp_len) * sizeof(__be32);
resp_iov.iov_base = response; resp_iov.iov_base = response;
resp_iov.iov_len = rbytes; resp_iov.iov_len = rbytes;
iov_iter_kvec(&resp_iter, WRITE, &resp_iov, 1, rbytes); iov_iter_kvec(&resp_iter, READ, &resp_iov, 1, rbytes);
/* Perform the command */ /* Perform the command */
mutex_lock(&sbefifo->lock); mutex_lock(&sbefifo->lock);
...@@ -817,7 +817,7 @@ static ssize_t sbefifo_user_read(struct file *file, char __user *buf, ...@@ -817,7 +817,7 @@ static ssize_t sbefifo_user_read(struct file *file, char __user *buf,
/* Prepare iov iterator */ /* Prepare iov iterator */
resp_iov.iov_base = buf; resp_iov.iov_base = buf;
resp_iov.iov_len = len; resp_iov.iov_len = len;
iov_iter_init(&resp_iter, WRITE, &resp_iov, 1, len); iov_iter_init(&resp_iter, READ, &resp_iov, 1, len);
/* Perform the command */ /* Perform the command */
mutex_lock(&sbefifo->lock); mutex_lock(&sbefifo->lock);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册