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 1149174 - targetcli failed to create block backstore
Summary: targetcli failed to create block backstore
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: python-rtslib
Version: 7.1
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Andy Grover
QA Contact: Bruno Goncalves
URL:
Whiteboard:
: 1172715 (view as bug list)
Depends On: 1151188
Blocks: 1129387
TreeView+ depends on / blocked
 
Reported: 2014-10-03 12:14 UTC by Bruno Goncalves
Modified: 2022-10-03 17:34 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-03-05 13:31:22 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:0581 0 normal SHIPPED_LIVE python-rtslib bug fix update 2015-03-05 17:00:54 UTC

Description Bruno Goncalves 2014-10-03 12:14:16 UTC
Description of problem:
Traceback when trying to create a block backtore device

Version-Release number of selected component (if applicable):
kernel-3.10.0-175.el7

How reproducible:
100%

Steps to Reproduce:
1.Try to device the backstore device being a loop device.


# dd if=/dev/zero of=/test.img count=1000 bs=1M
# losetup /dev/loop0 /test.img

# targetcli /backstores/block create target1-tpg1-lun1 /dev/loop0 
Traceback (most recent call last):
  File "/usr/bin/targetcli", line 89, in <module>
    main()
  File "/usr/bin/targetcli", line 72, in main
    shell.run_cmdline(" ".join(sys.argv[1:]))
  File "/usr/lib/python2.7/site-packages/configshell/shell.py", line 891, in run_cmdline
    self._execute_command(path, command, pparams, kparams)
  File "/usr/lib/python2.7/site-packages/configshell/shell.py", line 866, in _execute_command
    result = target.execute_command(command, pparams, kparams)
  File "/usr/lib/python2.7/site-packages/targetcli/ui_node.py", line 87, in execute_command
    pparams, kparams)
  File "/usr/lib/python2.7/site-packages/configshell/node.py", line 1417, in execute_command
    result = method(*pparams, **kparams)
  File "/usr/lib/python2.7/site-packages/targetcli/ui_backstore.py", line 387, in ui_command_create
    so = BlockStorageObject(name, dev, readonly=readonly, write_back=write_back)
  File "/usr/lib/python2.7/site-packages/rtslib/tcm.py", line 676, in __init__
    raise
TypeError: exceptions must be old-style classes or derived from BaseException, not NoneType

Actual results:


Expected results:


Additional info:
# fdisk -l /dev/loop0

Disk /dev/loop0: 1048 MB, 1048576000 bytes, 2048000 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

Comment 1 Bruno Goncalves 2014-10-03 12:15:01 UTC
Setting it as regression as using RHEL-7.0 kernel it works.

kernel-3.10.0-123.el7

Comment 3 Bruno Goncalves 2014-10-09 13:06:16 UTC
The regression seems to have been inserted by BZ#1129387.

It works on kernel-3.10.0-161.el7, but it fails on kernel-3.10.0-161.el7.

Comment 4 Bruno Goncalves 2014-10-09 13:08:03 UTC
Sorry, I meant to say it works on kernel -160.

Comment 5 Andy Grover 2014-10-09 19:53:04 UTC
This backported patch in the kernel:

target: Don't allow setting WC emulation if device doesn't support

caused a bug in python-rtslib to manifest. So no changes for kernel, we just need to update python-rtslib.

Comment 6 Andy Grover 2014-10-09 20:00:37 UTC
a workaround for now is to add "write_back=false" to the create command, e.g.:

targetcli /backstores/block create target1-tpg1-lun1 /dev/loop0 write_back=false

Comment 7 Bruno Goncalves 2014-10-29 08:23:39 UTC
Problem has been fixed on python-rtslib-2.1.fb50-1.el7.noarch.

# rpm -q targetcli
targetcli-2.1.fb34-1.el7.noarch

3.10.0-175.el7


# targetcli /backstores/block create target1-tpg1-lun1 /dev/loop0
Created block storage object target1-tpg1-lun1 using /dev/loop0.

# targetcli ls
o- / ......................................................................................................................... [...]
  o- backstores .............................................................................................................. [...]
  | o- block .................................................................................................. [Storage Objects: 1]
  | | o- target1-tpg1-lun1 ......................................................... [/dev/loop0 (1000.0MiB) write-thru deactivated]
  | o- fileio ................................................................................................. [Storage Objects: 0]
  | o- pscsi .................................................................................................. [Storage Objects: 0]
  | o- ramdisk ................................................................................................ [Storage Objects: 0]
  o- iscsi ............................................................................................................ [Targets: 0]
  o- loopback ......................................................................................................... [Targets: 0]

Comment 9 Andy Grover 2014-12-10 19:22:37 UTC
*** Bug 1172715 has been marked as a duplicate of this bug. ***

Comment 11 errata-xmlrpc 2015-03-05 13:31:22 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://rhn.redhat.com/errata/RHBA-2015-0581.html


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