Skip to content

Commit

Permalink
Fix bug caused by erroneous API usage.
Browse files Browse the repository at this point in the history
  • Loading branch information
votdev committed Mar 26, 2017
1 parent d07899a commit 8a2ff57
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 6 deletions.
6 changes: 6 additions & 0 deletions deb/openmediavault-usbbackup/debian/changelog
@@ -1,3 +1,9 @@
openmediavault-usbbackup (3.2.17) stable; urgency=low

* Fix bug caused by erroneous API usage.

-- Volker Theile <volker.theile@openmediavault.org> Sun, 26 Mar 2017 23:43:35 +0200

openmediavault-usbbackup (3.2.16) stable; urgency=low

* Various improvements.
Expand Down
2 changes: 1 addition & 1 deletion deb/openmediavault-usbbackup/debian/control
Expand Up @@ -9,7 +9,7 @@ Homepage: http://www.openmediavault.org

Package: openmediavault-usbbackup
Architecture: all
Depends: rsync, openmediavault (>= 3.0.67)
Depends: rsync, openmediavault (>= 3.0.68)
Priority: optional
Description: OpenMediaVault USB/eSATA backup plugin
Automatically synchronise a shared folder to an USB/eSATA device and vice
Expand Down
Expand Up @@ -76,7 +76,8 @@ class OMVRpcServiceUsbBackup extends \OMV\Rpc\ServiceAbstract {
// Get the filesystem implementation.
$fs = $fsb->getImpl($objectv['devicefile']);
// Get the parent storage device containing the filesystem.
if (FALSE === ($parentDeviceFile = $fs->getParentDeviceFile()))
$parentDeviceFile = $fs->getParentDeviceFile();
if (TRUE === is_null($parentDeviceFile))
continue;
\OMV\System\Storage\StorageDevice::assertStorageDeviceExists(
$parentDeviceFile);
Expand Down
Expand Up @@ -798,7 +798,8 @@ class OMVRpcServiceFileSystemMgmt extends \OMV\Rpc\ServiceAbstract {
}
// Get the parent storage device containing the filesystem, e.g.
// /dev/sdb or /dev/cciss/c0d0.
if (FALSE === ($parentDeviceFile = $fs->getParentDeviceFile())) {
$parentDeviceFile = $fs->getParentDeviceFile();
if (TRUE === is_null($parentDeviceFile)) {
throw new \OMV\Exception(
"Failed to get parent storage device file from '%s'.",
$fs->getDeviceFile());
Expand Down
Expand Up @@ -417,7 +417,7 @@ class Filesystem extends \OMV\System\BlockDevice implements IFilesystem,
* \li /dev/sdb1 => /dev/sdb
* \li /dev/cciss/c0d0p2 => /dev/cciss/c0d0
* </ul>
* @return The device file of the underlying storage device or FALSE
* @return The device file of the underlying storage device or NULL
* on failure.
*/
public function getParentDeviceFile() {
Expand All @@ -437,7 +437,7 @@ class Filesystem extends \OMV\System\BlockDevice implements IFilesystem,
// - /dev/loop0 => /dev/loop0
$mngr = \OMV\System\Storage\Backend\Manager::getInstance();
if (NULL === ($backend = $mngr->getBackend($deviceFile)))
return FALSE;
return NULL;
$parentDeviceFile = $backend->baseDeviceFile($deviceFile);
if (FALSE === is_devicefile_by_id($parentDeviceFile)) {
// Get the storage device file of the filesystems parent device.
Expand Down
Expand Up @@ -127,7 +127,8 @@ interface IFilesystem {
* \li /dev/sdb1 => /dev/sdb
* \li /dev/cciss/c0d0p2 => /dev/cciss/c0d0
* </ul>
* @return The device file of the underlying storage device.
* @return The device file of the underlying storage device or NULL
* on failure.
*/
public function getParentDeviceFile();

Expand Down

0 comments on commit 8a2ff57

Please sign in to comment.