]> git.baikalelectronics.ru Git - kernel.git/commitdiff
fix iov_iter_bvec() "direction" argument
authorAl Viro <viro@zeniv.linux.org.uk>
Thu, 15 Sep 2022 23:04:18 +0000 (19:04 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Feb 2023 10:28:03 +0000 (11:28 +0100)
[ Upstream commit b676668d99155e6859d99bbf2df18b3f03851902 ]

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Stable-dep-of: 6dd88fd59da8 ("vhost-scsi: unbreak any layout for response")
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/target/target_core_file.c

index 28aa643be5d5e3ac1b44957044d89e25f5fc1d09..55935040541b4ea60d61699a6b28adbbc6f87e4f 100644 (file)
@@ -337,7 +337,7 @@ static int fd_do_rw(struct se_cmd *cmd, struct file *fd,
                len += sg->length;
        }
 
-       iov_iter_bvec(&iter, READ, bvec, sgl_nents, len);
+       iov_iter_bvec(&iter, is_write, bvec, sgl_nents, len);
        if (is_write)
                ret = vfs_iter_write(fd, &iter, &pos, 0);
        else
@@ -473,7 +473,7 @@ fd_execute_write_same(struct se_cmd *cmd)
                len += se_dev->dev_attrib.block_size;
        }
 
-       iov_iter_bvec(&iter, READ, bvec, nolb, len);
+       iov_iter_bvec(&iter, WRITE, bvec, nolb, len);
        ret = vfs_iter_write(fd_dev->fd_file, &iter, &pos, 0);
 
        kfree(bvec);