summaryrefslogtreecommitdiffstats
path: root/0047-RHBZ-980777-kpartx-read-only-loop-devs.patch
diff options
context:
space:
mode:
Diffstat (limited to '0047-RHBZ-980777-kpartx-read-only-loop-devs.patch')
-rw-r--r--0047-RHBZ-980777-kpartx-read-only-loop-devs.patch39
1 files changed, 39 insertions, 0 deletions
diff --git a/0047-RHBZ-980777-kpartx-read-only-loop-devs.patch b/0047-RHBZ-980777-kpartx-read-only-loop-devs.patch
new file mode 100644
index 0000000..ed79e22
--- /dev/null
+++ b/0047-RHBZ-980777-kpartx-read-only-loop-devs.patch
@@ -0,0 +1,39 @@
+---
+ kpartx/kpartx.c | 3 +--
+ kpartx/lopart.c | 2 +-
+ 2 files changed, 2 insertions(+), 3 deletions(-)
+
+Index: multipath-tools-130222/kpartx/kpartx.c
+===================================================================
+--- multipath-tools-130222.orig/kpartx/kpartx.c
++++ multipath-tools-130222/kpartx/kpartx.c
+@@ -204,7 +204,6 @@ main(int argc, char **argv){
+ char * delim = NULL;
+ char *uuid = NULL;
+ char *mapname = NULL;
+- int loopro = 0;
+ int hotplug = 0;
+ int loopcreated = 0;
+ struct stat buf;
+@@ -315,7 +314,7 @@ main(int argc, char **argv){
+ if (!loopdev) {
+ loopdev = find_unused_loop_device();
+
+- if (set_loop(loopdev, device, 0, &loopro)) {
++ if (set_loop(loopdev, device, 0, &ro)) {
+ fprintf(stderr, "can't set up loop\n");
+ exit (1);
+ }
+Index: multipath-tools-130222/kpartx/lopart.c
+===================================================================
+--- multipath-tools-130222.orig/kpartx/lopart.c
++++ multipath-tools-130222/kpartx/lopart.c
+@@ -230,7 +230,7 @@ set_loop (const char *device, const char
+
+ if ((ffd = open (file, mode)) < 0) {
+
+- if (!*loopro && errno == EROFS)
++ if (!*loopro && (errno == EROFS || errno == EACCES))
+ ffd = open (file, mode = O_RDONLY);
+
+ if (ffd < 0) {