Bug 1667505 - Permission denied: '/sys/kernel/config/target/core/fileio_.../xxx/attrib/pi_prot_format'
Summary: Permission denied: '/sys/kernel/config/target/core/fileio_.../xxx/attrib/pi_p...
Status: NEW
Alias: None
Product: Fedora
Classification: Fedora
Component: kernel
Version: rawhide
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
Assignee: Kernel Maintainer List
QA Contact: Fedora Extras Quality Assurance
Depends On:
TreeView+ depends on / blocked
Reported: 2019-01-18 16:11 UTC by Tomáš Bžatek
Modified: 2020-09-15 20:38 UTC (History)
19 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed:
Type: Bug

Attachments (Terms of Use)

Description Tomáš Bžatek 2019-01-18 16:11:29 UTC

How reproducible:

Steps to Reproduce:
1. # truncate -s 1G /tmp/xxx
2. # targetcli /backstores/fileio/ create xxx /tmp/xxx
Created fileio xxx with size 1073741824
3. # targetcli /backstores/fileio/xxx info 
[Errno 13] Permission denied: '/sys/kernel/config/target/core/fileio_28/xxx/attrib/pi_prot_format'

Also getting nice Python traceback when running targetcli interactively:

# targetcli 
> targetcli shell version 2.1.fb49
> Copyright 2011-2013 by Datera, Inc and others.
> For help on commands, type 'help'.
>  /> /backstores/fileio/xxx info
> Traceback (most recent call last):
>   File "/usr/bin/targetcli", line 122, in <module>
>     main()
>   File "/usr/bin/targetcli", line 112, in main
>     shell.run_interactive()
>   File "/usr/lib/python3.7/site-packages/configshell_fb/shell.py", line 905, in run_interactive
>     self._cli_loop()
>   File "/usr/lib/python3.7/site-packages/configshell_fb/shell.py", line 734, in _cli_loop
>     self.run_cmdline(cmdline)
>   File "/usr/lib/python3.7/site-packages/configshell_fb/shell.py", line 848, in run_cmdline
>     self._execute_command(path, command, pparams, kparams)
>   File "/usr/lib/python3.7/site-packages/configshell_fb/shell.py", line 823, in _execute_command
>     result = target.execute_command(command, pparams, kparams)
>   File "/usr/lib/python3.7/site-packages/configshell_fb/node.py", line 1406, in execute_command
>     return method(*pparams, **kparams)
>   File "/usr/lib/python3.7/site-packages/targetcli/ui_node.py", line 207, in ui_command_info
>     info = self.rtsnode.dump()
>   File "/usr/lib/python3.7/site-packages/rtslib_fb/tcm.py", line 693, in dump
>     d = super(FileIOStorageObject, self).dump()
>   File "/usr/lib/python3.7/site-packages/rtslib_fb/tcm.py", line 314, in dump
>     d = super(StorageObject, self).dump()
>   File "/usr/lib/python3.7/site-packages/rtslib_fb/node.py", line 225, in dump
>     attrs[item] = int(self.get_attribute(item))
>   File "/usr/lib/python3.7/site-packages/rtslib_fb/node.py", line 168, in get_attribute
>     return fread(path)
>   File "/usr/lib/python3.7/site-packages/rtslib_fb/utils.py", line 100, in fread
>     with open(path, 'r') as file_fd:
> PermissionError: [Errno 13] Permission denied: '/sys/kernel/config/target/core/fileio_28/xxx/attrib/pi_prot_format'

Additional info:
Not necessarily targetcli bug in its nature, filing for consideration and better error handling.

Comment 1 Tomáš Bžatek 2019-01-18 16:21:56 UTC
Works fine with kernel-4.20.3-200.fc29

Comment 2 openstack team 2019-02-03 13:48:43 UTC
failed since kernel-5.x.x, issue reproduced also with kernel-5.0.0-0.rc4.git3.1.fc30

Comment 3 Laura Abbott 2019-02-03 16:50:28 UTC
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=6baca7601bdee2e57f20c45d63eb53b89b33e816 Looks like this was changed to write-only intentionally and the code is opening with read. This is a userspace regression so I can see about getting this reverted but it also sounds like this should be fixed in targetcli as well.

Comment 4 Maurizio Lombardi 2019-02-07 15:16:43 UTC
This is going to be fixed in kernel 5.0


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