]> code.ossystems Code Review - openembedded-core.git/commit
libparted: Use read only when probing devices on linux
authorOvidiu Panait <ovidiu.panait@windriver.com>
Tue, 26 Sep 2017 09:00:46 +0000 (12:00 +0300)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 6 Oct 2017 11:03:31 +0000 (12:03 +0100)
commitf68fca4776a38a1bdf7ed37ce87cddbb21ff74f8
treef4715beb1ed58f92641599ea507e2b99e600a302
parent23155b607c509b799775949774ad7da23c10b373
libparted: Use read only when probing devices on linux

When a device is opened for RW closing it can trigger other actions,
like udev scanning it for partition changes. Use read only for the
init_* methods and RW for actual changes to the device.

This adds _device_open which takes mode flags as an argument and turns
linux_open into a wrapper for it with RW_MODE.

_device_open_ro is added to open the device with RD_MODE and increment
the open_counter. This is used in the init_* functions.

_device_close is a wrapper around linux_close that decrements the
open_counter and is used in the init_* functions.

All of these changes are self-contained with no external API changes.
The only visible change in behavior is that when a new PedDevice is
created the device is opened in RO_MODE instead of RW_MODE.

Resolves: rhbz#1245144

Reference:
https://bugzilla.redhat.com/show_bug.cgi?id=1283112

Upstream patch:
http://git.savannah.gnu.org/cgit/parted.git/commit/?id=44d5ae0115c4ecfe3158748309e9912c5aede92d

Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
meta/recipes-extended/parted/files/0001-libparted-Use-read-only-when-probing-devices-on-linu.patch [new file with mode: 0644]
meta/recipes-extended/parted/parted_3.2.bb