Changeset f63a0073 in mainline


Ignore:
Timestamp:
2015-11-17T10:23:24Z (9 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
363a504
Parents:
ed9bf14
Message:

Fix dummy partition handling when label creation fails.

Location:
uspace
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/fdisk/src/fdisk.c

    red9bf14 rf63a0073  
    4040#include <loc.h>
    4141#include <mem.h>
    42 #include <stdio.h>
    4342#include <stdlib.h>
    4443#include <str.h>
     
    634633
    635634        rc = vbd_label_create(dev->fdisk->vbd, dev->sid, ltype);
    636         if (rc != EOK)
     635        if (rc != EOK) {
     636                /* Re-add dummy partition */
     637                (void) fdisk_dev_add_parts(dev);
    637638                return rc;
     639        }
    638640
    639641        rc = fdisk_update_dev_info(dev);
  • uspace/srv/bd/vbd/disk.c

    red9bf14 rf63a0073  
    538538        label_info_t linfo;
    539539        vbds_disk_t *disk;
    540         int rc;
     540        int rc, rc2;
    541541
    542542        log_msg(LOG_DEFAULT, LVL_DEBUG, "vbds_label_create(%zu)", sid);
     
    583583        log_msg(LOG_DEFAULT, LVL_DEBUG, "vbds_label_create(%zu) - failure", sid);
    584584        if (disk->label == NULL) {
    585                 rc = label_open(sid, &label);
    586                 if (rc != EOK) {
     585                rc2 = label_open(sid, &label);
     586                if (rc2 != EOK) {
    587587                        log_msg(LOG_DEFAULT, LVL_ERROR, "Failed to open label in disk %s.",
    588588                            disk->svc_name);
     589                        return rc2;
    589590                }
     591
     592                disk->label = label;
     593                (void) vbds_disk_parts_add(disk, label);
    590594        }
    591595
Note: See TracChangeset for help on using the changeset viewer.