summaryrefslogtreecommitdiffstats
path: root/meta-networking
diff options
context:
space:
mode:
authorJagadeesh Krishnanjanappa <jkrishnanjanappa@mvista.com>2016-04-10 09:35:27 +0530
committerJoe MacDonald <joe_macdonald@mentor.com>2016-04-29 11:57:47 -0400
commit37c8e1f9909610be7a80074e379ef5c8290bc206 (patch)
tree25736c832fd0edd0723d820f71ce3104491c7607 /meta-networking
parenteba63b3b2e6fcc83d03f6d09f833152ae9c9ee83 (diff)
downloadmeta-openembedded-37c8e1f9909610be7a80074e379ef5c8290bc206.tar.gz
iscsitarget: resolve build error with linux kernel 4.3 and above
1. test_bit was used to return true boolean value, if BIO_UPTODATE bit of bio->bi_flags is set. But the same job can be done by checking bio->bi_error, implemented in linux kernel 4.3 and above. If bio->bi_error is set, then it denotes error. Ref: https://github.com/torvalds/linux/commit/4246a0b63bd8f56a1469b12eafeb875b1041a451 It solves below build error: -- snip -- iscsitarget-1.4.20.3+svn502/kernel/block-io.c:40:19: error: 'BIO_UPTODATE' undeclared (first use in this function) error = test_bit(BIO_UPTODATE, &bio->bi_flags) ? error : -EIO; -- CUT -- 2. bio can always be filled to a maximum value of BIO_MAX_PAGES, so no need to check for min value for linux kernel 4.3 and above. Ref: https://github.com/torvalds/linux/commit/b54ffb73cadcdcff9cc1ae0e11f502407e3e2e4c It solves below build error: -- snip -- iscsitarget-1.4.20.3+svn502/kernel/block-io.c:80:15: error: implicit declaration of function 'bio_get_nr_vecs' [-Werror=implicit-function-declaration] max_pages = bio_get_nr_vecs(bio_data->bdev); -- CUT -- 3. Remove unwanted explicit setting of CFLAGS and CC flags. Setting them in oe_runmake command, will override CFLAGS mentioned in iscsitarget Makefile and resulting in a below error: -- snip -- In file included from iscsid.c:38:0: iscsid.h:38:19: fatal error: iet_u.h: No such file or directory compilation terminated. In file included from conn.c:15:0: iscsid.h:38:19: fatal error: iet_u.h: No such file or directory compilation terminated. -- CUT -- Signed-off-by: Jagadeesh Krishnanjanappa <jkrishnanjanappa@mvista.com> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
Diffstat (limited to 'meta-networking')
-rw-r--r--meta-networking/recipes-extended/iscsitarget/files/build_with_updated_bio_struct_of_linux_v4.3_and_above.patch75
-rw-r--r--meta-networking/recipes-extended/iscsitarget/iscsitarget_1.4.20.3+svn502.bb8
2 files changed, 78 insertions, 5 deletions
diff --git a/meta-networking/recipes-extended/iscsitarget/files/build_with_updated_bio_struct_of_linux_v4.3_and_above.patch b/meta-networking/recipes-extended/iscsitarget/files/build_with_updated_bio_struct_of_linux_v4.3_and_above.patch
new file mode 100644
index 000000000..0e8b792af
--- /dev/null
+++ b/meta-networking/recipes-extended/iscsitarget/files/build_with_updated_bio_struct_of_linux_v4.3_and_above.patch
@@ -0,0 +1,75 @@
11. test_bit was used to return true boolean value, if
2 BIO_UPTODATE bit of bio->bi_flags is set. But the same
3 job can be done by checking bio->bi_error, implemented in
4 linux kernel 4.3 and above. If bio->bi_error is set, then
5 it denotes error.
6
7Ref: https://github.com/torvalds/linux/commit/4246a0b63bd8f56a1469b12eafeb875b1041a451
8
9It solves below build error:
10-- snip --
11iscsitarget-1.4.20.3+svn502/kernel/block-io.c:40:19: error: 'BIO_UPTODATE' undeclared (first use in this function)
12 error = test_bit(BIO_UPTODATE, &bio->bi_flags) ? error : -EIO;
13-- CUT --
14
152. bio can always be filled to a maximum value of BIO_MAX_PAGES,
16 so no need to check for min value for linux kernel 4.3 and above.
17
18Ref: https://github.com/torvalds/linux/commit/b54ffb73cadcdcff9cc1ae0e11f502407e3e2e4c
19
20It solves below build error:
21-- snip --
22iscsitarget-1.4.20.3+svn502/kernel/block-io.c:80:15: error: implicit declaration of function 'bio_get_nr_vecs' [-Werror=implicit-function-declaration]
23 max_pages = bio_get_nr_vecs(bio_data->bdev);
24-- CUT --
25
26Upstream-Status: Pending
27
28Signed-off-by: Jagadeesh Krishnanjanappa <jkrishnanjanappa@mvista.com>
29
30diff -Naurp iscsitarget-1.4.20.3+svn502_org/kernel/block-io.c iscsitarget-1.4.20.3+svn502/kernel/block-io.c
31--- iscsitarget-1.4.20.3+svn502_org/kernel/block-io.c 2016-04-01 09:07:12.891810059 +0530
32+++ iscsitarget-1.4.20.3+svn502/kernel/block-io.c 2016-04-01 09:15:59.076469313 +0530
33@@ -33,7 +33,11 @@ static void blockio_bio_endio(struct bio
34 {
35 struct tio_work *tio_work = bio->bi_private;
36
37+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 3, 0)
38+ error = bio->bi_error ? -EIO : error;
39+#else
40 error = test_bit(BIO_UPTODATE, &bio->bi_flags) ? error : -EIO;
41+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(4, 3, 0) */
42
43 if (error)
44 atomic_set(&tio_work->error, error);
45@@ -61,6 +65,10 @@ blockio_make_request(struct iet_volume *
46 u32 size = tio->size;
47 u32 tio_index = 0;
48
49+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 3, 0)
50+ int err = 0;
51+ loff_t ppos = tio->offset;
52+#else
53 int max_pages = 1;
54 int err = 0;
55
56@@ -69,6 +77,7 @@ blockio_make_request(struct iet_volume *
57 /* Calculate max_pages for bio_alloc (memory saver) */
58 if (bdev_q)
59 max_pages = bio_get_nr_vecs(bio_data->bdev);
60+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(4, 3, 0) */
61
62 tio_work = kzalloc(sizeof (*tio_work), GFP_KERNEL);
63 if (!tio_work)
64@@ -80,7 +89,11 @@ blockio_make_request(struct iet_volume *
65
66 /* Main processing loop, allocate and fill all bios */
67 while (size && tio_index < tio->pg_cnt) {
68+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 3, 0)
69+ bio = bio_alloc(GFP_KERNEL, BIO_MAX_PAGES);
70+#else
71 bio = bio_alloc(GFP_KERNEL, min(max_pages, BIO_MAX_PAGES));
72+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(4, 3, 0) */
73 if (!bio) {
74 err = -ENOMEM;
75 goto out;
diff --git a/meta-networking/recipes-extended/iscsitarget/iscsitarget_1.4.20.3+svn502.bb b/meta-networking/recipes-extended/iscsitarget/iscsitarget_1.4.20.3+svn502.bb
index 6a2b135fa..4c5eed6de 100644
--- a/meta-networking/recipes-extended/iscsitarget/iscsitarget_1.4.20.3+svn502.bb
+++ b/meta-networking/recipes-extended/iscsitarget/iscsitarget_1.4.20.3+svn502.bb
@@ -8,13 +8,12 @@ LICENSE = "GPLv2"
8LIC_FILES_CHKSUM = "file://COPYING;md5=6e233eda45c807aa29aeaa6d94bc48a2" 8LIC_FILES_CHKSUM = "file://COPYING;md5=6e233eda45c807aa29aeaa6d94bc48a2"
9DEPENDS = "openssl virtual/kernel" 9DEPENDS = "openssl virtual/kernel"
10 10
11PNBLACKLIST[iscsitarget] ?= "BROKEN: kernel/block-io.c:36:19: error: 'BIO_UPTODATE' undeclared (first use in this function)"
12
13SRC_URI = "http://ftp.heanet.ie/mirrors/ubuntu/pool/universe/i/${BPN}/${BPN}_${PV}.orig.tar.gz \ 11SRC_URI = "http://ftp.heanet.ie/mirrors/ubuntu/pool/universe/i/${BPN}/${BPN}_${PV}.orig.tar.gz \
14 file://use-kernel-makefile-to-get-kernel-version.patch \ 12 file://use-kernel-makefile-to-get-kernel-version.patch \
15 file://fix-errors-observed-with-linux-3.19-and-greater.patch \ 13 file://fix-errors-observed-with-linux-3.19-and-greater.patch \
16 file://access-sk_v6_daddr-iff-IPV6-defined.patch \ 14 file://access-sk_v6_daddr-iff-IPV6-defined.patch \
17 " 15 file://build_with_updated_bio_struct_of_linux_v4.3_and_above.patch"
16
18SRC_URI[md5sum] = "ef9bc823bbabd3c772208c00d5f2d089" 17SRC_URI[md5sum] = "ef9bc823bbabd3c772208c00d5f2d089"
19SRC_URI[sha256sum] = "d3196ccb78a43266dce28587bfe30d8ab4db7566d7bce96057dfbb84100babb5" 18SRC_URI[sha256sum] = "d3196ccb78a43266dce28587bfe30d8ab4db7566d7bce96057dfbb84100babb5"
20 19
@@ -27,8 +26,7 @@ do_configure[noexec] = "1"
27do_make_scripts[depends] += "virtual/kernel:do_shared_workdir" 26do_make_scripts[depends] += "virtual/kernel:do_shared_workdir"
28 27
29do_compile() { 28do_compile() {
30 oe_runmake KSRC=${STAGING_KERNEL_DIR} CFLAGS='${CFLAGS}' LDFLAGS='' \ 29 oe_runmake KSRC=${STAGING_KERNEL_DIR} LDFLAGS='' V=1
31 CC="${CC}" V=1
32} 30}
33 31
34do_install() { 32do_install() {