Changeset 6a0db524 in mainline


Ignore:
Timestamp:
2015-10-09T22:18:34Z (9 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
4b6635a7
Parents:
3a43785
Message:

More checks.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/bd/vbd/disk.c

    r3a43785 r6a0db524  
    490490
    491491        rc = label_get_info(disk->label, &linfo);
     492        if (rc != EOK)
     493                return rc;
    492494
    493495        info->ltype = linfo.ltype;
     
    534536{
    535537        label_t *label;
     538        label_info_t linfo;
    536539        vbds_disk_t *disk;
    537540        int rc;
     
    545548
    546549        log_msg(LOG_DEFAULT, LVL_NOTE, "vbds_label_create(%zu) - label_close", sid);
     550
     551        /* Verify that current label is a dummy label */
     552        rc = label_get_info(disk->label, &linfo);
     553        if (rc != EOK)
     554                return rc;
     555
     556        if (linfo.ltype != lt_none) {
     557                log_msg(LOG_DEFAULT, LVL_ERROR, "Label already exists.");
     558                return EEXIST;
     559        }
    547560
    548561        /* Close dummy label first */
Note: See TracChangeset for help on using the changeset viewer.