From b28b1d9809a8e67ed37377dd555870f0536fc66b Mon Sep 17 00:00:00 2001 From: Zhiqiang Liu Date: Mon, 2 Nov 2020 09:56:14 +0800 Subject: [PATCH] python-rtslib: backport one upstream patch - epoch2 backport one upstream patch to fix EPERM error. Signed-off-by: Zhiqiang Liu --- ...ERM-errors-with-scsi_generic-devices.patch | 26 +++++++++++++++++++ python-rtslib.spec | 6 ++++- 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 0003-Fix-EPERM-errors-with-scsi_generic-devices.patch diff --git a/0003-Fix-EPERM-errors-with-scsi_generic-devices.patch b/0003-Fix-EPERM-errors-with-scsi_generic-devices.patch new file mode 100644 index 0000000..48a16c6 --- /dev/null +++ b/0003-Fix-EPERM-errors-with-scsi_generic-devices.patch @@ -0,0 +1,26 @@ +From 964520037320534512713e58bf70be6c428097dc Mon Sep 17 00:00:00 2001 +From: Jaroslav +Date: Tue, 7 Jul 2020 11:21:45 +0200 +Subject: [PATCH 1/4] Fix EPERM errors with scsi_generic devices + +Resolves https://github.com/open-iscsi/targetcli-fb/issues/158 +--- + rtslib/utils.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/rtslib/utils.py b/rtslib/utils.py +index eff2205..4bcadea 100644 +--- a/rtslib/utils.py ++++ b/rtslib/utils.py +@@ -114,7 +114,7 @@ def is_dev_in_use(path): + ''' + path = os.path.realpath(str(path)) + try: +- file_fd = os.open(path, os.O_EXCL|os.O_NDELAY) ++ file_fd = os.open(path, os.O_EXCL|os.O_NDELAY|os.O_RDWR) + except OSError: + return True + else: +-- +1.8.3.1 + diff --git a/python-rtslib.spec b/python-rtslib.spec index ba8ad9d..7610e05 100644 --- a/python-rtslib.spec +++ b/python-rtslib.spec @@ -4,7 +4,7 @@ Name: python-rtslib Version: 2.1.70 -Release: 6 +Release: 7 Summary: Python object API for Linux kernel LIO SCSI target License: ASL 2.0 @@ -12,6 +12,7 @@ URL: https://github.com/open-iscsi/%{oname} Source0: %{url}/archive/v%{version}/%{oname}-%{version}.tar.gz Patch1: 0001-saveconfig-copy-temp-configfile-with-permissions.patch Patch2: 0002-saveconfig-open-the-temp-configfile-with-modes-set.patch +Patch3: 0003-Fix-EPERM-errors-with-scsi_generic-devices.patch BuildArch: noarch BuildRequires: systemd-units @@ -120,6 +121,9 @@ install -m 644 doc/saveconfig.json.5.gz %{buildroot}%{_mandir}/man5/ %{_mandir}/man5/saveconfig.json.5.gz %changelog +* Mon Nov 2 2020 Zhiqiang Liu - 2.1.70-7 +- backport upstream patch to solve one problem + * Fri Oct 30 2020 tianwei - 2.1.70-6 - remove python2 -- Gitee