[Trusty] iscsitarget-dkms fails to build on linux-lts-xenial kernel

Bug #1732746 reported by Kleber Sacilotto de Souza on 2017-11-16
This bug affects 1 person
Affects Status Importance Assigned to Milestone
iscsitarget (Ubuntu)
Thadeu Lima de Souza Cascardo
Thadeu Lima de Souza Cascardo

Bug Description

iscsitarget-dkms will fail to build for 4.4.0 kernels on trusty, when their ABI start with 1, like in -100 or -101.

[Test Case]
Install different kernels, including 3.13, and 4.4, and 4.4.0-78, 4.4.0-81 and 4.4.0-101. That means different kernel base versions, different ABIs, including the offending one (that starts with 1), and the one that had not have the sock_recvmsg signature changed. All build successfully.

[Regression Potential]
Builds could fail with a future kernel or an old kernel we haven't tested with. A similar solution has already been applied to xenial. Some other way of calling dkms could make the build fail. Different ways have been tested in this case.

iscsitarget ADT tests are failing on Trusty with linux-meta-lts-xenial 4.4.0-101.124~14.04.1 due to iscsitarget-dkms compilation failure.

amd64: https://objectstorage.prodstack4-5.canonical.com/v1/AUTH_77e2ada1e7a84929a74ba3b87153c0ac/autopkgtest-trusty/trusty/amd64/i/iscsitarget/20171115_174514_4fc3d@/log.gz

i386: https://objectstorage.prodstack4-5.canonical.com/v1/AUTH_77e2ada1e7a84929a74ba3b87153c0ac/autopkgtest-trusty/trusty/i386/i/iscsitarget/20171115_174142_4fc3d@/log.gz

ppc64el: https://objectstorage.prodstack4-5.canonical.com/v1/AUTH_77e2ada1e7a84929a74ba3b87153c0ac/autopkgtest-trusty/trusty/ppc64el/i/iscsitarget/20171115_174421_4fc3d@/log.gz

ChristianEhrhardt (paelzer) wrote :

I'm so glad we removed that later due to being unmaintained :-/
See bug 1613758

But for this lets take a look at what recent stable updates trigger ...

ChristianEhrhardt (paelzer) wrote :

Iniital checks on testbed setup

1. dkms build against Trusty base kernel 3.13.0-135-generic - ok
2. dkms build against current Trusty HWE kernel 4.4.0-98-generic - ok
3. build against proposed Trusty HWE kernel 4.4.0-101-generic - the reported error

In detail it is:
/var/lib/dkms/iscsitarget/ In function ‘do_recv’:
/var/lib/dkms/iscsitarget/ error: too many arguments to function ‘sock_recvmsg’
  res = sock_recvmsg(conn->sock, &msg, len, MSG_DONTWAIT | MSG_NOSIGNAL);
In file included from include/linux/skbuff.h:29:0,
                 from include/linux/if_ether.h:23,
                 from include/uapi/linux/ethtool.h:17,
                 from include/linux/ethtool.h:17,
                 from include/linux/netdevice.h:42,
                 from include/net/sock.h:51,
                 from /var/lib/dkms/iscsitarget/,
                 from /var/lib/dkms/iscsitarget/
include/linux/net.h:220:5: note: declared here
 int sock_recvmsg(struct socket *sock, struct msghdr *msg, int flags);
=> http://paste.ubuntu.com/25979971/

ChristianEhrhardt (paelzer) wrote :

Really the prototype of sock_recvmsg changed ??
I don't think so, but we need to find what is going on. ? (insert a little bit of WTF here)

One odd thing - I see only in the bad case
applying patch compat-4.4.0-84.patch...patching file kernel/nthread.c

That is from:

And here comes an interesting bit:
- res = sock_recvmsg(conn->sock, &msg, MSG_DONTWAIT | MSG_NOSIGNAL);
+ res = sock_recvmsg(conn->sock, &msg, len, MSG_DONTWAIT | MSG_NOSIGNAL);

So the package already carries a compat patch (from where that comes from I don't know yet).
That patch is only applied to the new kernel in proposed.
And that makes it fail.

investigating ...

Changed in iscsitarget (Ubuntu):
status: New → Confirmed
ChristianEhrhardt (paelzer) wrote :

So the problem came in with:
iscsitarget ( trusty; urgency=medium

  * d/p/(porting|compat|enable)-4.4.0-84.patch:
    Add compat code to build with Ubuntu 4.4.0-84 (LP: #1701697)
 -- Thadeu Lima de Souza Cascardo <email address hidden> Wed, 12 Jul 2017 20:13:41 +0000

Per [1] this is applied if PATCH_MATCH matches.
But it is applied to 101 as that applies to "4\.4\.0-([1-7])"
Note: There is an implicit .* following

We would have to fix the rule to not patch it if >

[1]: http://manpages.ubuntu.com/manpages/xenial/man8/dkms.8.html

Changed in iscsitarget (Ubuntu):
status: Confirmed → Triaged
ChristianEhrhardt (paelzer) wrote :

it worked in my local tests, but @cascardo since you wrote the initial patch - could you give that a review?

Also I haven't checked but if you brought the same change to Xenial it will need the same fix there.

ChristianEhrhardt (paelzer) wrote :

Hmm, bug 1701697 lists Xenial - I'd wait for Cascardos comment but would expect the same breakage there.

Changed in iscsitarget (Ubuntu):
assignee: nobody → Thadeu Lima de Souza Cascardo (cascardo)
Changed in iscsitarget (Ubuntu Trusty):
status: New → Triaged
Changed in iscsitarget (Ubuntu Xenial):
status: New → Incomplete
tags: added: patch

It happens that the match was no good, and we replaced it with a grep for the source that we uploaded for xenial. For some reason, we forgot about trusty, so I am applying the same fix we added in xenial which explains why linux-4.4.0-101-generic didn't hit the issue.


ChristianEhrhardt (paelzer) wrote :

Ok cascardo, that means it is fixed in Xenial and you'll take Trusty by moving your existing fix there then - thanks for the info - updating tasks.

Changed in iscsitarget (Ubuntu):
status: Triaged → Fix Released
Changed in iscsitarget (Ubuntu Xenial):
status: Incomplete → Fix Released
Changed in iscsitarget (Ubuntu Trusty):
assignee: nobody → Thadeu Lima de Souza Cascardo (cascardo)
description: updated
Changed in iscsitarget (Ubuntu Trusty):
status: Triaged → In Progress
importance: Undecided → Medium
Changed in iscsitarget (Ubuntu):
importance: Undecided → Medium
Changed in iscsitarget (Ubuntu Xenial):
importance: Undecided → Medium

Hello Kleber, or anyone else affected,

Accepted iscsitarget into trusty-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/iscsitarget/ in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed.Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-trusty to verification-done-trusty. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-trusty. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in iscsitarget (Ubuntu Trusty):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-trusty
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers