Hello community,

here is the log from the commit of package parted for openSUSE:Factory checked 
in at 2016-08-25 09:48:45
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/parted (Old)
 and      /work/SRC/openSUSE:Factory/.parted.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "parted"

Changes:
--------
--- /work/SRC/openSUSE:Factory/parted/parted.changes    2016-06-26 
23:51:49.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.parted.new/parted.changes       2016-08-25 
09:48:47.000000000 +0200
@@ -1,0 +2,14 @@
+Tue Aug  9 14:36:20 CEST 2016 - [email protected]
+
+- Sync with SLES-12 SP2 for bsc#979275
+  - amend: libparted-open-the-device-RO-and-lazily-switch-to-RW.patch
+
+-------------------------------------------------------------------
+Tue Aug  9 14:04:47 CEST 2016 - [email protected]
+
+- Correctly flush caches before reading from the device
+  (bsc#989751)
+  - amend: libparted-open-the-device-RO-and-lazily-switch-to-RW.patch
+  - refresh: libparted-Add-support-for-NVMe-devices.patch
+
+-------------------------------------------------------------------

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

Other differences:
------------------
++++++ libparted-Add-support-for-NVMe-devices.patch ++++++
--- /var/tmp/diff_new_pack.S9SOO7/_old  2016-08-25 09:48:48.000000000 +0200
+++ /var/tmp/diff_new_pack.S9SOO7/_new  2016-08-25 09:48:48.000000000 +0200
@@ -50,8 +50,8 @@
  
  #define SCSI_BLK_MAJOR(M) (                                             \
                  (M) == SCSI_DISK0_MAJOR                                 \
-@@ -463,6 +464,12 @@ _ensure_read_write (PedDevice *dev)
-        _flush_cache (dev);
+@@ -461,6 +462,12 @@ _ensure_read_write (PedDevice *dev)
+             return;
  }
  
 +static int
@@ -63,7 +63,7 @@
  #ifdef ENABLE_DEVICE_MAPPER
  static int
  _dm_task_run_wait (struct dm_task *task, uint32_t cookie)
-@@ -714,6 +721,8 @@ _device_probe_type (PedDevice* dev)
+@@ -712,6 +719,8 @@ _device_probe_type (PedDevice* dev)
                  dev->type = PED_DEVICE_LOOP;
          } else if (dev_major == MD_MAJOR) {
                  dev->type = PED_DEVICE_MD;
@@ -72,7 +72,7 @@
          } else {
                  dev->type = PED_DEVICE_UNKNOWN;
          }
-@@ -1473,6 +1482,11 @@ linux_new (const char* path)
+@@ -1471,6 +1480,11 @@ linux_new (const char* path)
                          goto error_free_arch_specific;
                  break;
  

++++++ libparted-open-the-device-RO-and-lazily-switch-to-RW.patch ++++++
--- /var/tmp/diff_new_pack.S9SOO7/_old  2016-08-25 09:48:48.000000000 +0200
+++ /var/tmp/diff_new_pack.S9SOO7/_new  2016-08-25 09:48:48.000000000 +0200
@@ -4,6 +4,11 @@
 Subject: [PATCH] libparted: open the device RO and lazily switch to RW only if
  necessary
 
+[sparschauer: Use _flush_cache() also for reads, don't switch to RW
+ in _flush_cache() to avoid a possible recursion (bnc#989751), open
+ partitions in _flush_cache() O_RDONLY instead of O_WRONLY]
+Signed-off-by: Sebastian Parschauer <[email protected]>
+
 Avoid useless udev events triggered by opening the device RW
 for purely read-only operations.
 
@@ -14,11 +19,11 @@
  libparted/arch/linux.h |  1 +
  2 files changed, 31 insertions(+), 3 deletions(-)
 
-diff --git a/libparted/arch/linux.c b/libparted/arch/linux.c
-index 326b956..0a50452 100644
---- a/libparted/arch/linux.c
-+++ b/libparted/arch/linux.c
-@@ -294,6 +294,9 @@ static unsigned int _device_get_partition_range(PedDevice 
const* dev);
+Index: parted-3.2/libparted/arch/linux.c
+===================================================================
+--- parted-3.2.orig/libparted/arch/linux.c
++++ parted-3.2/libparted/arch/linux.c
+@@ -295,6 +295,9 @@ static unsigned int _device_get_partitio
  static int _device_open (PedDevice* dev, int flags);
  static int _device_open_ro (PedDevice* dev);
  static int _device_close (PedDevice* dev);
@@ -28,7 +33,7 @@
  
  static int
  _read_fd (int fd, char **buf)
-@@ -441,6 +444,24 @@ _is_virtblk_major (int major)
+@@ -442,6 +445,22 @@ _is_virtblk_major (int major)
          return _major_type_in_devices (major, "virtblk");
  }
  
@@ -46,22 +51,21 @@
 +
 +       if (!_device_open (dev, RW_MODE))
 +            return;
-+
-+       _flush_cache (dev);
 +}
 +
  #ifdef ENABLE_DEVICE_MAPPER
  static int
  _dm_task_run_wait (struct dm_task *task, uint32_t cookie)
-@@ -1604,6 +1625,7 @@ _flush_cache (PedDevice* dev)
- 
-         if (dev->read_only)
-                 return;
-+        _ensure_read_write (dev);
-         dev->dirty = 0;
- 
-         ioctl (arch_specific->fd, BLKFLSBUF);
-@@ -1647,7 +1669,7 @@ _device_open_ro (PedDevice* dev)
+@@ -1603,7 +1622,7 @@ _flush_cache (PedDevice* dev)
+                 if (!name)
+                         break;
+                 if (!_partition_is_mounted_by_path (name)) {
+-                        fd = open (name, WR_MODE, 0);
++                        fd = open (name, RD_MODE, 0);
+                         if (fd > 0) {
+                                 ioctl (fd, BLKFLSBUF);
+ retry:
+@@ -1634,7 +1653,7 @@ _device_open_ro (PedDevice* dev)
  static int
  linux_open (PedDevice* dev)
  {
@@ -70,7 +74,7 @@
  }
  
  static int
-@@ -1685,10 +1707,12 @@ retry:
+@@ -1672,6 +1691,10 @@ retry:
                  }
          } else {
                  dev->read_only = 0;
@@ -80,12 +84,8 @@
 +                      arch_specific->rw = 0;
          }
  
--        _flush_cache (dev);
--
-         return 1;
- }
- 
-@@ -1920,6 +1944,7 @@ _write_lastoddsector (PedDevice* dev, const void* buffer)
+         _flush_cache (dev);
+@@ -1907,6 +1930,7 @@ _write_lastoddsector (PedDevice* dev, co
  
          PED_ASSERT(dev != NULL);
          PED_ASSERT(buffer != NULL);
@@ -93,15 +93,17 @@
  
          arch_specific = LINUX_SPECIFIC (dev);
  
-@@ -1968,6 +1993,7 @@ linux_write (PedDevice* dev, const void* buffer, 
PedSector start,
+@@ -1955,6 +1979,9 @@ linux_write (PedDevice* dev, const void*
                          return 1;
          }
  
 +        _ensure_read_write (dev);
++        if (count == 0)
++                return 1;  /* We just ensured the device is open RW (see call 
from dasd_write()) */
          if (_get_linux_version() < KERNEL_VERSION (2,6,0)) {
                  /* Kludge.  This is necessary to read/write the last
                     block of an odd-sized disk, until Linux 2.5.x kernel fixes.
-@@ -2497,6 +2523,7 @@ _blkpg_part_command (PedDevice* dev, struct 
blkpg_partition* part, int op)
+@@ -2480,6 +2507,7 @@ _blkpg_part_command (PedDevice* dev, str
          LinuxSpecific*          arch_specific = LINUX_SPECIFIC (dev);
          struct blkpg_ioctl_arg  ioctl_arg;
  
@@ -109,10 +111,10 @@
          ioctl_arg.op = op;
          ioctl_arg.flags = 0;
          ioctl_arg.datalen = sizeof (struct blkpg_partition);
-diff --git a/libparted/arch/linux.h b/libparted/arch/linux.h
-index 95def1f..926f7e2 100644
---- a/libparted/arch/linux.h
-+++ b/libparted/arch/linux.h
+Index: parted-3.2/libparted/arch/linux.h
+===================================================================
+--- parted-3.2.orig/libparted/arch/linux.h
++++ parted-3.2/libparted/arch/linux.h
 @@ -30,6 +30,7 @@ struct _LinuxSpecific {
        int     fd;
        int     major;
@@ -121,6 +123,18 @@
        char*   dmtype;         /**< device map target type */
  #if defined __s390__ || defined __s390x__
        unsigned int real_sector_size;
--- 
-1.8.4.5
-
+Index: parted-3.2/libparted/labels/dasd.c
+===================================================================
+--- parted-3.2.orig/libparted/labels/dasd.c
++++ parted-3.2/libparted/labels/dasd.c
+@@ -639,6 +639,10 @@ dasd_write (const PedDisk* disk)
+       if (disk_specific->format_type == 1)
+               return 1;
+ 
++      /* Ensure the device is open RW */
++      char dummy[10]; /* to avoid assertion in ped_device_write */
++      ped_device_write(disk->dev, &dummy, 0, 0);
++
+       /* initialize the anchor */
+       fdasd_initialize_anchor(&anchor);
+       fdasd_get_geometry(disk->dev, &anchor, arch_specific->fd);




Reply via email to