Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 454128 - sys-fs/gentoo-sources-3.7.4 - NULL reference OOPS in target_fabric_port_link because 0ff8754 depends on missing patch 0fd97cc
Summary: sys-fs/gentoo-sources-3.7.4 - NULL reference OOPS in target_fabric_port_link ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Kernel Bug Wranglers and Kernel Maintainers
URL:
Whiteboard: linux-3.7.4-regression
Keywords: REGRESSION
Depends on:
Blocks:
 
Reported: 2013-01-26 10:58 UTC by Ben Peddell
Modified: 2013-02-09 12:15 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
Oops from target_fabric_port_link (file_454128.txt,2.23 KB, text/plain)
2013-01-26 10:58 UTC, Ben Peddell
Details
target: Move dev->dev_link_magic check to after dev initialization (0001-target-Move-dev-dev_link_magic-check-to-after-dev-in.patch,1.90 KB, patch)
2013-02-03 07:14 UTC, Ben Peddell
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ben Peddell 2013-01-26 10:58:13 UTC
There is a NULL reference OOPS in target_fabric_port_link.

Reproducible: Always

Steps to Reproduce:
1. Install sys-kernel/gentoo-sources-3.7.4 and sys-block/lio-utils
2. Run kernel 3.7.4 with the iscsi target either compiled in or as a module
3. Start /etc/init.d/target
Actual Results:  
Oops in target_fabric_port_link

Expected Results:  
iSCSI target starts without errors

The 3.7.4 release on kernel.org seems to have brought in commit 0ff8754 (target: Add link_magic for fabric allow_link destination target_items) without bringing in commit 0fd97cc (target: kill struct se_subsystem_dev), which commit 0ff8754 is based upon.
Comment 1 Ben Peddell 2013-01-26 10:58:58 UTC
Created attachment 336878 [details]
Oops from target_fabric_port_link
Comment 2 Tom Wijsman (TomWij) (RETIRED) gentoo-dev 2013-01-26 11:13:41 UTC
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=0ff8754981261a80f4b77db2536dfea92c2d4539

http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=0fd97ccf45be26fb01b3a412f1f6c6b5044b2f16

Feels like commit 0fd97ccf45be26fb01b3a412f1f6c6b5044b2f16 was taken instead of 3d70f8c617a436c7146ecb81df2265b4626dfe89 (Linux 3.7-rc4) to produce the 3.7.4 patchset.
Comment 3 Ben Peddell 2013-01-26 11:49:24 UTC
The gentoo-sources maintainer appears to have taken the right commit - commit 8a69ca20f06d1878aa0ee8000a60d8226ab6b6a1 (Linux 3.7.4).

However, the linux-stable 3.7.y kernel series maintainter appears to have merged commit 0ff8754981261a80f4b77db2536dfea92c2d4539 (target: Add link_magic for fabric allow_link destination target_items) as merge commit fdf9d862969f1be18814273b03fb9497ec2dbdae without merging commit 0fd97ccf45be26fb01b3a412f1f6c6b5044b2f16.

http://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=commit;h=fdf9d862969f1be18814273b03fb9497ec2dbdae
Comment 4 Mike Pagano gentoo-dev 2013-01-27 16:17:30 UTC
Will adding 0fd97ccf45be26fb01b3a412f1f6c6b5044b2f16 to 3.7 solve the issue?
Comment 5 Tom Wijsman (TomWij) (RETIRED) gentoo-dev 2013-01-28 12:54:21 UTC
(In reply to comment #3)
> The gentoo-sources maintainer appears to have taken the right commit - commit 8a69ca20f06d1878aa0ee8000a60d8226ab6b6a1 (Linux 3.7.4).
>
> However, the linux-stable 3.7.y kernel series maintainter appears to have
> merged commit 0ff8754981261a80f4b77db2536dfea92c2d4539 (target: Add
> link_magic for fabric allow_link destination target_items) as merge commit
> fdf9d862969f1be18814273b03fb9497ec2dbdae without merging commit
> 0fd97ccf45be26fb01b3a412f1f6c6b5044b2f16.

Ah, I wasn't using the stable kernel in my case and got confused about how stable releases work, I've read up on it and now see they port over commits to a separate stable tree. A search for that missing commit in the log of Linux 3.7.4 on there indeed yields no result.

http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Fstable%2Flinux-stable.git&a=search&h=8a69ca20f06d1878aa0ee8000a60d8226ab6b6a1&st=commit&s=0fd97ccf45be26fb01b3a412f1f6c6b5044b2f16

As mpagano asked, can you confirm that adding this missing commit fixes this?

http://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=commitdiff_plain;h=0fd97ccf45be26fb01b3a412f1f6c6b5044b2f16

You can download that and run `patch -p1 < file_name_here` in the kernel dir.
Comment 6 Ben Peddell 2013-02-03 06:53:36 UTC
The 0fd97ccf45be26fb01b3a412f1f6c6b5044b2f16 looks too invasive to merge as is.  I believe that it is only one place where commit 0ff8754981261a80f4b77db2536dfea92c2d4539 causes an OOPS, and it can be resolved by moving the dev->dev_link_magic check to after de_device *dev is initialized in target_fabric_port_link.  Either that or simply revert fdf9d862969f1be18814273b03fb9497ec2dbdae.
Comment 7 Ben Peddell 2013-02-03 07:14:20 UTC
Created attachment 337748 [details, diff]
target: Move dev->dev_link_magic check to after dev initialization

Commit fdf9d862969f1be18814273b03fb9497ec2dbdae (target: Add link_magic
for fabric allow_link destination target_items) applied without commit
0fd97ccf45be26fb01b3a412f1f6c6b5044b2f16 (Simplify the code a lot by
killing the superflous struct se_subsystem_dev) put the
dev->dev_link_magic check before dev was initialized in
target_fabric_port_link.  This patch moves the dev->dev_link_magic check
to after dev is initialized.
Comment 8 Ben Peddell 2013-02-03 09:08:07 UTC
I have submitted patches upstream for linux-3.4.y and linux-3.7.y, both of which are affected by this regression.

https://patchwork.kernel.org/patch/2086021/
https://patchwork.kernel.org/patch/2086011/
Comment 9 Ben Peddell 2013-02-03 09:43:04 UTC
Should have looked at the stable queue first - an equivalent of my patch is already in the stable queue for linux-3.4.y and linux-3.7.y
Comment 11 Ben Peddell 2013-02-05 14:34:49 UTC
This is fixed in 3.7.6 and 3.4.29