Hi Himanshu, (Adding HCH, as commit 9ac8928e6a are his changes) On Fri, 2015-05-29 at 20:22 +0000, Himanshu Madhani wrote: > adding mailing list > > > > From: Himanshu Madhani <himanshu.madhani@xxxxxxxxxx> > Date: Friday, May 29, 2015 at 11:59 AM > To: "Nicholas A. Bellinger" <nab@xxxxxxxxxxxxxxx> > Cc: Quinn Tran <quinn.tran@xxxxxxxxxx>, Arun Easi <arun.easi@xxxxxxxxxx>, > Giridhar Malavali <giridhar.malavali@xxxxxxxxxx> > Subject: Targetcli issue with 4.1.0-rc5+ and qla2xxx > > > >Hi Nicholas, > > > >I just updated my kernel to 4.1.0-rc5+ and I am seeing problem to create > >ram disk target with latest kernel. > > > >/> cd backstores/ramdisk > >/backstores/ramdisk> create rm_lun0 1G > >Created ramdisk rm_lun0 with size 1G. > >/backstores/ramdisk> ls > >o- ramdisk > >.......................................................................... > >................. [Storage Objects: 1] > > o- rm_lun0 > >.......................................................................... > >............. [(1.0GiB) deactivated] > >/backstores/ramdisk> cd .. > >/backstores> cd .. > >/> cd qla2xxx > > > >/qla2xxx> create 21:00:00:24:ff:78:46:b4 > >Cannot change enable state: [Errno 19] No such device > > > >/qla2xxx> create naa.2100000e1e08c720 > >Cannot change enable state: [Errno 19] No such device > > > > > >Note when I revert back to 4.0.0-rc7+ I am able to create the ram disk > >target. I¹ve identified the patch by which introduced this regression > > > >https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id > >=9ac8928e6a3e1ed02e632e45aa766129fe6b1802 > > > >I also verified while debugging this that directory structured did get > >created for target portal group before we go enable it. > > > >Here¹s script that I used to check that the call to create tpgt_1 was > >successful > > > ># tcm_setup.sh -m qla2xxx -c > >++ lsmod > >++ grep -w '^tcm_qla2xxx' > >+ tmp='tcm_qla2xxx 28705 0 ' > >+ [[ tcm_qla2xxx 28705 0 == '' ]] > >+ mount -t configfs configfs /sys/kernel/config > >+ mkdir /sys/kernel/config/target/qla2xxx > >+ cd /sys/kernel/config/target/core > >+ mkdir rd_mcp_0 > >+ mkdir rd_mcp_0/q_tcm_mcp.0 > >+ echo rd_pages=12800 > >+ echo 1 > >+ echo 73f3ebae-f06f-41be-94ca-3d7ec76f > >+ cd /sys/kernel/config/target/qla2xxx > >+ mkdir 21:00:00:0e:1e:08:c7:20 > >+ cd /sys/kernel/config/target/qla2xxx/21:00:00:0e:1e:08:c7:20 > >+ mkdir tpgt_1 > >+ [[ fc == \i\s\c\s\i ]] > >+ mkdir tpgt_1/lun/lun_0 > >+ ln -s /sys/kernel/config/target/core/rd_mcp_0/q_tcm_mcp.0 > >/sys/kernel/config/target/qla2xxx/21:00:00:0e:1e:08:c7:20/tpgt_1/lun/lun_0 > >/tcm_123 > >+ cd /sys/kernel/config/target/qla2xxx/21:00:00:0e:1e:08:c7:20/tpgt_1/acls > >+ mkdir 21:00:00:0e:1e:15:f7:50 > >+ mkdir 21:00:00:0e:1e:15:f7:50/lun_0 > >+ ln -s > >/sys/kernel/config/target/qla2xxx/21:00:00:0e:1e:08:c7:20/tpgt_1/lun/lun_0 > > 21:00:00:0e:1e:15:f7:50/lun_0/ > >+ cd /sys/kernel/config/target/qla2xxx/21:00:00:0e:1e:08:c7:20/tpgt_1 > >+ [[ fc == \i\s\c\s\i ]] > >+ [[ tcm_qla2xxx == \t\c\m\_\q\l\a\4\x\x\x ]] > >+ echo 1 > >/root/bin/tcm_setup.sh: line 152: echo: write error: No such device > > > >Here¹s same script I ran with this setup before the patch ("target: > >simplify the target template registration > > API²) > > > ># ./tcm_setup.sh -m qla2xxx -c > >++ lsmod > >++ grep -w '^tcm_qla2xxx' > >+ tmp='tcm_qla2xxx 29399 0 ' > >+ [[ tcm_qla2xxx 29399 0 == '' ]] > >+ mount -t configfs configfs /sys/kernel/config > >+ mkdir /sys/kernel/config/target/qla2xxx > >+ cd /sys/kernel/config/target/core > >+ mkdir rd_mcp_0 > >+ mkdir rd_mcp_0/q_tcm_mcp.0 > >+ echo rd_pages=12800 > >+ echo 1 > >+ echo 73f3ebae-f06f-41be-94ca-73dd50ed > >+ cd /sys/kernel/config/target/qla2xxx > >+ mkdir 21:00:00:0e:1e:08:c7:20 > >+ cd /sys/kernel/config/target/qla2xxx/21:00:00:0e:1e:08:c7:20 > >+ mkdir tpgt_1 > >+ [[ fc == \i\s\c\s\i ]] > >+ mkdir tpgt_1/lun/lun_0 > >+ ln -s /sys/kernel/config/target/core/rd_mcp_0/q_tcm_mcp.0 > >/sys/kernel/config/target/qla2xxx/21:00:00:0e:1e:08:c7:20/tpgt_1/lun/lun_0 > >/tcm_123 > >+ cd /sys/kernel/config/target/qla2xxx/21:00:00:0e:1e:08:c7:20/tpgt_1/acls > >+ mkdir 21:00:00:0e:1e:15:f7:50 > >+ mkdir 21:00:00:0e:1e:15:f7:50/lun_0 > >+ ln -s > >/sys/kernel/config/target/qla2xxx/21:00:00:0e:1e:08:c7:20/tpgt_1/lun/lun_0 > > 21:00:00:0e:1e:15:f7:50/lun_0/ > >+ cd /sys/kernel/config/target/qla2xxx/21:00:00:0e:1e:08:c7:20/tpgt_1 > >+ [[ fc == \i\s\c\s\i ]] > >+ [[ tcm_qla2xxx == \t\c\m\_\q\l\a\4\x\x\x ]] > >+ echo 1 > > > >Any suggestion to fix this would be really helpful. > > Thanks for tracking down the offending commit. This is a regression around se_portal_group->se_tpg_tfo->tf_subsys usage with configfs_depend_item() in tcm_qla2xxx_depend_tpg(). Prior to the changes in commit 9ac8928e6, the ->tf_subsys pointer would be set at target_core_register_fabric() time. With these fabric API registration changes in place, all target_core_fabric_ops (tfo) definitions are marked as const so this assignment is no longer happening, thus causing configfs_depend_item() to fail with -ENOENT because it can't locate a valid configfs_dirent. So this regression was already fixed in a subsequent patch from HCH that's queued in for-next code. I've cherry-picked it out of for-next into target-pending/master here: target: Fix se_tpg_tfo->tf_subsys regression + remove tf_subsystem https://git.kernel.org/cgit/linux/kernel/git/nab/target-pending.git/commit/?id=d588cf8f618d7b316743a0bc99fede20f7a01bb7 and will be pushing to mainline for v4.1-rc6 shortly. Thanks for reporting! --nab -- To unsubscribe from this list: send the line "unsubscribe target-devel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html