python-rtslib/0003-Fix-EPERM-errors-with-scsi_generic-devices.patch

27 lines
759 B
Diff
Raw Normal View History

From 964520037320534512713e58bf70be6c428097dc Mon Sep 17 00:00:00 2001
From: Jaroslav <niekto@niekde.sk>
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