Hello community,

here is the log from the commit of package btrfsprogs for openSUSE:Factory 
checked in at 2013-08-27 20:32:46
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/btrfsprogs (Old)
 and      /work/SRC/openSUSE:Factory/.btrfsprogs.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "btrfsprogs"

Changes:
--------
--- /work/SRC/openSUSE:Factory/btrfsprogs/btrfsprogs.changes    2013-07-29 
17:35:56.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.btrfsprogs.new/btrfsprogs.changes       
2013-08-27 20:32:47.000000000 +0200
@@ -1,0 +2,6 @@
+Fri Aug  9 14:03:04 CEST 2013 - dste...@suse.cz
+
+- added 0040-btrfs-progs-fix-loop-device-mount-checks.patch: fix
+  loop mount detection again (bnc#834173)
+
+-------------------------------------------------------------------

New:
----
  0040-btrfs-progs-fix-loop-device-mount-checks.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ btrfsprogs.spec ++++++
--- /var/tmp/diff_new_pack.BIWTzs/_old  2013-08-27 20:32:48.000000000 +0200
+++ /var/tmp/diff_new_pack.BIWTzs/_new  2013-08-27 20:32:48.000000000 +0200
@@ -34,6 +34,7 @@
 Source3:        80-btrfs.rules
 Patch10:        0010-Btrfs-progs-make-btrfsck-a-hardlink-at-install-time.patch
 Patch12:        0012-libbtrfs-Set-SONAME-to-libbtrfs.so.0-instead-of-libb.patch
+Patch40:        0040-btrfs-progs-fix-loop-device-mount-checks.patch
 Patch1000:      local-version-override.patch
 Patch1001:      btrfs-progs-use-IEEE1541-suffixes-for-sizes.patch
 Patch1002:      btrfs-progs-add-man-page-for-btrfs-convert.patch
@@ -75,6 +76,7 @@
 %setup -q -n btrfs-progs-%{tar_version}
 %patch10 -p1
 %patch12 -p1
+%patch40 -p1
 %patch1000 -p1
 %patch1001 -p1
 %patch1002 -p1

++++++ 0040-btrfs-progs-fix-loop-device-mount-checks.patch ++++++
>From be65fb331902152d9b571b2d4ee1bf26bedc795f Mon Sep 17 00:00:00 2001
From: David Sterba <dste...@suse.cz>
Date: Thu, 27 Oct 2011 16:23:14 -0400
Subject: [PATCH 40/46] btrfs-progs: fix loop device mount checks

When creating a fs on a loop device, mkfs checks whether the same file
is not already mounted, but the backing file of another loop dev may not
exist and mkfs fails.

Signed-off-by: David Sterba <dste...@suse.cz>
---
 utils.c | 34 +++++++++++++++++++---------------
 1 file changed, 19 insertions(+), 15 deletions(-)

diff --git a/utils.c b/utils.c
index 41bfdb0..47b31fc 100644
--- a/utils.c
+++ b/utils.c
@@ -773,11 +773,11 @@ int is_same_blk_file(const char* a, const char* b)
        char real_a[PATH_MAX];
        char real_b[PATH_MAX];
 
-       if(!realpath(a, real_a) ||
-          !realpath(b, real_b))
-       {
-               return -errno;
-       }
+       if(!realpath(a, real_a))
+               strcpy(real_a, a);
+
+       if (!realpath(b, real_b))
+               strcpy(real_b, b);
 
        /* Identical path? */
        if(strcmp(real_a, real_b) == 0)
@@ -818,8 +818,8 @@ int is_same_loop_file(const char* a, const char* b)
 {
        char res_a[PATH_MAX];
        char res_b[PATH_MAX];
-       const char* final_a;
-       const char* final_b;
+       const char* final_a = NULL;
+       const char* final_b = NULL;
        int ret;
 
        /* Resolve a if it is a loop device */
@@ -828,10 +828,12 @@ int is_same_loop_file(const char* a, const char* b)
                        return 0;
                return ret;
        } else if (ret) {
-               if ((ret = resolve_loop_device(a, res_a, sizeof(res_a))) < 0)
-                       return ret;
-
-               final_a = res_a;
+               if ((ret = resolve_loop_device(a, res_a, sizeof(res_a))) < 0) {
+                       if (errno != EPERM)
+                               return ret;
+               }
+               else
+                       final_a = res_a;
        } else {
                final_a = a;
        }
@@ -842,10 +844,12 @@ int is_same_loop_file(const char* a, const char* b)
                        return 0;
                return ret;
        } else if (ret) {
-               if((ret = resolve_loop_device(b, res_b, sizeof(res_b))) < 0)
-                       return ret;
-
-               final_b = res_b;
+               if ((ret = resolve_loop_device(b, res_b, sizeof(res_b))) < 0) {
+                       if (errno != EPERM)
+                               return ret;
+               }
+               else
+                       final_b = res_b;
        } else {
                final_b = b;
        }
-- 
1.8.0.2

-- 
To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org
For additional commands, e-mail: opensuse-commit+h...@opensuse.org

Reply via email to