RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1445536 - targetd create_export fails to map lun to an initiator acl if lun is already mapped in the target.
Summary: targetd create_export fails to map lun to an initiator acl if lun is already ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: targetd
Version: 7.3
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Tony Asleson
QA Contact: Martin Hoyer
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-04-25 21:56 UTC by Clark Hale
Modified: 2021-09-06 12:33 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-08-01 20:43:39 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Modification of client script to induce issue (3.71 KB, text/x-python)
2017-04-25 21:56 UTC, Clark Hale
no flags Details
Patch to correct the issue (516 bytes, patch)
2017-04-25 22:08 UTC, Clark Hale
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2017:1982 0 normal SHIPPED_LIVE targetd bug fix and enhancement update 2017-08-01 18:31:11 UTC

Description Clark Hale 2017-04-25 21:56:40 UTC
Created attachment 1274032 [details]
Modification of client script to induce issue

Description of problem:

create_export will not create a mapped LUN for an initiator if that same lun is mapped to a different initiator.

Version-Release number of selected component (if applicable):


How reproducible:

Reproducible every time.

Steps to Reproduce:

These two targetd API calls will show the bug:
jsonrequest('export_create', dict(pool=pool, vol='test18', initiator_wwn='iqn.2006-03.com.wtf.ohyeah:661', lun=1))
jsonrequest('export_create', dict(pool=pool, vol='test18', initiator_wwn='iqn.2006-03.com.wtf.ohyeah:662', lun=1))

More detailed steps:

1. Setup a host with targetd
2. Modify the attached client script to suit the test environment, specifically
line 46-53:
user = "admin"
password = "redhat"
host = '172.31.0.127'
port = 18700
path = '/targetrpc'
id_num = 1
ssl = False
pool = 'my_vg'

3. Execute client script
4. Observe output on iscsi server.


Actual results:
/iscsi/iqn.20...uto/tpg1/acls> ls
o- acls ............................................................................ [ACLs: 2]
  o- iqn.2006-03.com.wtf.ohyeah:661 ......................................... [Mapped LUNs: 1]
  | o- mapped_lun1 ............................................ [lun0 block/my_vg:test18 (rw)]
  o- iqn.2006-03.com.wtf.ohyeah:662 ......................................... [Mapped LUNs: 0]

Expected results:
o- acls ............................................................................ [ACLs: 2]
  o- iqn.2006-03.com.wtf.ohyeah:661 ......................................... [Mapped LUNs: 1]
  | o- mapped_lun1 ............................................ [lun0 block/my_vg:test18 (rw)]
  o- iqn.2006-03.com.wtf.ohyeah:662 ......................................... [Mapped LUNs: 1]
    o- mapped_lun1 ............................................ [lun0 block/my_vg:test18 (rw)]


Additional info:

Comment 2 Clark Hale 2017-04-25 22:08:49 UTC
Created attachment 1274034 [details]
Patch to correct the issue

This patch should fix the issue, by looking at both if a mapped lun exists in the target AND if that LUN is mapped in an initiator acl.

Comment 3 Tony Asleson 2017-04-26 20:19:28 UTC
Upstream PR merged: https://github.com/open-iscsi/targetd/pull/20

Comment 6 Martin Hoyer 2017-05-29 11:15:17 UTC
Tested with targetd-0.8.6-1.el7.
No regression found.

Comment 7 errata-xmlrpc 2017-08-01 20:43:39 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2017:1982


Note You need to log in before you can comment on or make changes to this bug.