]> git.ipfire.org Git - people/stevee/ipfire-3.x.git/blobdiff - multipath-tools/patches/0047-RHBZ-980777-kpartx-read-only-loop-devs.patch
multipath-tools: Update to snapshot from 2013-02-22
[people/stevee/ipfire-3.x.git] / multipath-tools / patches / 0047-RHBZ-980777-kpartx-read-only-loop-devs.patch
diff --git a/multipath-tools/patches/0047-RHBZ-980777-kpartx-read-only-loop-devs.patch b/multipath-tools/patches/0047-RHBZ-980777-kpartx-read-only-loop-devs.patch
new file mode 100644 (file)
index 0000000..ed79e22
--- /dev/null
@@ -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) {