From 7eccc85e2ff0b6dde302b19b54136443656d8c16 Mon Sep 17 00:00:00 2001 From: Zhiqiang Liu Date: Thu, 29 Oct 2020 21:20:44 +0800 Subject: [PATCH] python-rtslib: backport one patch to fix EPERM errors with scsi_generic devices backport one patch to fix EPERM errors with scsi_generic devices Signed-off-by: Zhiqiang Liu --- ...ERM-errors-with-scsi_generic-devices.patch | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) 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 + -- Gitee