goto out;
if (adm_ctx.tconn) {
- retcode = ERR_INVALID_REQUEST;
- drbd_msg_put_info("connection exists");
+ if (info->nlhdr->nlmsg_flags & NLM_F_EXCL) {
+ retcode = ERR_INVALID_REQUEST;
+ drbd_msg_put_info("connection exists");
+ }
+ /* else: still NO_ERROR */
goto out;
}
goto out;
}
+ /* drbd_adm_prepare made sure already
+ * that mdev->tconn and mdev->vnr match the request. */
+ if (adm_ctx.mdev) {
+ if (info->nlhdr->nlmsg_flags & NLM_F_EXCL)
+ retcode = ERR_MINOR_EXISTS;
+ /* else: still NO_ERROR */
+ goto out;
+ }
+
retcode = conn_new_minor(adm_ctx.tconn, dh->minor, adm_ctx.volume);
out:
drbd_adm_finish(info, retcode);