summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsrivijitha dugganapalli <Srivijitha.Dugganapalli@Sun.COM>2010-06-09 09:43:56 -0600
committersrivijitha dugganapalli <Srivijitha.Dugganapalli@Sun.COM>2010-06-09 09:43:56 -0600
commita1837c6df940f4a4992df53cc52935596ced1b89 (patch)
treeebe8d78699645751c7e2a549ae04051ffb8ed85a
parentd5ab4bd8f9e03d84b5f600a779f771e2efa7eb82 (diff)
downloadillumos-joyent-a1837c6df940f4a4992df53cc52935596ced1b89.tar.gz
6940963 stmfImportLu() should populate luGuid when error STMF_ERROR_FILE_IN_USE is returned
-rw-r--r--usr/src/lib/libstmf/common/stmf.c11
-rw-r--r--usr/src/uts/common/io/comstar/lu/stmf_sbd/sbd.c2
2 files changed, 11 insertions, 2 deletions
diff --git a/usr/src/lib/libstmf/common/stmf.c b/usr/src/lib/libstmf/common/stmf.c
index 54599ea240..216a14460d 100644
--- a/usr/src/lib/libstmf/common/stmf.c
+++ b/usr/src/lib/libstmf/common/stmf.c
@@ -19,8 +19,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
*/
#include <stdlib.h>
@@ -1414,6 +1413,13 @@ importDiskLu(char *fname, stmfGuid *createdGuid)
ioctlRet = ioctl(fd, SBD_IOCTL_IMPORT_LU, &sbdIoctl);
if (ioctlRet != 0) {
+
+ if (createdGuid && sbdIoctl.stmf_error ==
+ SBD_RET_FILE_ALREADY_REGISTERED) {
+ bcopy(sbdLu->ilu_ret_guid, createdGuid->guid,
+ sizeof (sbdLu->ilu_ret_guid));
+ }
+
savedErrno = errno;
switch (savedErrno) {
case EBUSY:
@@ -1435,6 +1441,7 @@ importDiskLu(char *fname, stmfGuid *createdGuid)
}
}
+
if (ret != STMF_STATUS_SUCCESS) {
goto done;
}
diff --git a/usr/src/uts/common/io/comstar/lu/stmf_sbd/sbd.c b/usr/src/uts/common/io/comstar/lu/stmf_sbd/sbd.c
index 0b45c9cc9b..d3c2cdb0bf 100644
--- a/usr/src/uts/common/io/comstar/lu/stmf_sbd/sbd.c
+++ b/usr/src/uts/common/io/comstar/lu/stmf_sbd/sbd.c
@@ -2256,6 +2256,7 @@ sbd_import_lu(sbd_import_lu_t *ilu, int struct_sz, uint32_t *err_ret,
}
} else {
*err_ret = SBD_RET_FILE_ALREADY_REGISTERED;
+ bcopy(sl->sl_device_id + 4, ilu->ilu_ret_guid, 16);
sl->sl_trans_op = SL_OP_NONE;
return (EALREADY);
}
@@ -2289,6 +2290,7 @@ sbd_import_lu(sbd_import_lu_t *ilu, int struct_sz, uint32_t *err_ret,
if (!no_register) {
if (sbd_link_lu(sl) != SBD_SUCCESS) {
*err_ret = SBD_RET_FILE_ALREADY_REGISTERED;
+ bcopy(sl->sl_device_id + 4, ilu->ilu_ret_guid, 16);
ret = EALREADY;
goto sim_err_out;
}