aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-09-16 10:10:52 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-09-16 10:10:52 +0200
commit18a818c5933952c404d6e4ce26d2df3109852313 (patch)
tree4e2df679d3c62825f5523cf14589a6ce573ae6d7
parent5e19ec80e1834a56303bf494fe97c01883f2002e (diff)
downloadqueue-3.18-18a818c5933952c404d6e4ce26d2df3109852313.tar.gz
fix patch
-rw-r--r--vhost-make-sure-log_num-in_num.patch20
1 files changed, 11 insertions, 9 deletions
diff --git a/vhost-make-sure-log_num-in_num.patch b/vhost-make-sure-log_num-in_num.patch
index 8e10b22..3057584 100644
--- a/vhost-make-sure-log_num-in_num.patch
+++ b/vhost-make-sure-log_num-in_num.patch
@@ -28,25 +28,27 @@ Reviewed-by: Tyler Hicks <tyhicks@canonical.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c
-index 34ea219936e3..acabf20b069e 100644
+---
+ drivers/vhost/vhost.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
--- a/drivers/vhost/vhost.c
+++ b/drivers/vhost/vhost.c
-@@ -2180,7 +2180,7 @@ static int get_indirect(struct vhost_virtqueue *vq,
+@@ -1174,7 +1174,7 @@ static int get_indirect(struct vhost_vir
/* If this is an input descriptor, increment that count. */
- if (access == VHOST_ACCESS_WO) {
+ if (desc.flags & VRING_DESC_F_WRITE) {
*in_num += ret;
- if (unlikely(log)) {
+ if (unlikely(log && ret)) {
- log[*log_num].addr = vhost64_to_cpu(vq, desc.addr);
- log[*log_num].len = vhost32_to_cpu(vq, desc.len);
+ log[*log_num].addr = desc.addr;
+ log[*log_num].len = desc.len;
++*log_num;
-@@ -2321,7 +2321,7 @@ int vhost_get_vq_desc(struct vhost_virtqueue *vq,
+@@ -1297,7 +1297,7 @@ int vhost_get_vq_desc(struct vhost_virtq
/* If this is an input descriptor,
* increment that count. */
*in_num += ret;
- if (unlikely(log)) {
+ if (unlikely(log && ret)) {
- log[*log_num].addr = vhost64_to_cpu(vq, desc.addr);
- log[*log_num].len = vhost32_to_cpu(vq, desc.len);
+ log[*log_num].addr = desc.addr;
+ log[*log_num].len = desc.len;
++*log_num;