Skip to content

Commit

Permalink
Merge pull request #1058 from eric-ch/s8-blktap2-sanity
Browse files Browse the repository at this point in the history
STABLE-8: blktap: Amend sanity check.
  • Loading branch information
jean-edouard authored Oct 30, 2018
2 parents 0785d44 + 44bbb09 commit d3d9210
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions recipes-kernel/linux/4.14/patches/blktap2.patch
Original file line number Diff line number Diff line change
Expand Up @@ -1296,7 +1296,7 @@ PATCHES
+}
--- /dev/null
+++ b/drivers/block/blktap/request.c
@@ -0,0 +1,419 @@
@@ -0,0 +1,425 @@
+#include <linux/mempool.h>
+#include <linux/spinlock.h>
+#include <linux/mutex.h>
Expand Down Expand Up @@ -1435,16 +1435,22 @@ PATCHES
+{
+ struct scatterlist *sg = &request->sg_table[seg];
+ void *s, *p;
+ if (!sg || !request) return;
+
+ if (!sg || !request)
+ return;
+
+ BUG_ON(seg >= request->nr_pages);
+
+
+ s = sg_virt(sg);
+ p = page_address(request->pages[seg]) + sg->offset;
+ if (!s || !p) return;
+ if (write) {
+ p = page_address(request->pages[seg]);
+ if (!s || !p)
+ return;
+
+ p = (uint8_t*)p + sg->offset;
+ if (write)
+ memcpy(p, s, sg->length);
+ } else {
+ memcpy(s, p, sg->length); }
+ else
+ memcpy(s, p, sg->length);
+}
+
+static void
Expand Down

0 comments on commit d3d9210

Please sign in to comment.