#define OBD_CONNECT_BULK_MBITS 0x2000000000000000ULL
#define OBD_CONNECT_OBDOPACK 0x4000000000000000ULL /* compact OUT obdo */
#define OBD_CONNECT_FLAGS2 0x8000000000000000ULL /* second flags word */
+/* ocd_connect_flags2 flags */
+#define OBD_CONNECT2_FILE_SECCTX 0x1ULL /* set file security context at create */
+
/* XXX README XXX:
* Please DO NOT add flag values here before first ensuring that this same
* flag value is not in use on some other branch. Please clear any such
OBD_CONNECT_DIR_STRIPE | \
OBD_CONNECT_BULK_MBITS | \
OBD_CONNECT_MULTIMODRPCS | \
- OBD_CONNECT_SUBTREE)
+ OBD_CONNECT_SUBTREE | \
+ OBD_CONNECT_FLAGS2)
+
+#define MDT_CONNECT_SUPPORTED2 OBD_CONNECT2_FILE_SECCTX
#define OST_CONNECT_SUPPORTED (OBD_CONNECT_SRVLOCK | OBD_CONNECT_GRANT | \
OBD_CONNECT_REQPORTAL | OBD_CONNECT_VERSION | \
OBD_CONNECT_PINGLESS | OBD_CONNECT_LFSCK | \
OBD_CONNECT_BULK_MBITS | \
OBD_CONNECT_GRANT_PARAM)
-#define ECHO_CONNECT_SUPPORTED (0)
+#define OST_CONNECT_SUPPORTED2 0
+
+#define ECHO_CONNECT_SUPPORTED 0
+#define ECHO_CONNECT_SUPPORTED2 0
+
#define MGS_CONNECT_SUPPORTED (OBD_CONNECT_VERSION | OBD_CONNECT_AT | \
OBD_CONNECT_FULL20 | OBD_CONNECT_IMP_RECOV | \
OBD_CONNECT_MNE_SWAB | OBD_CONNECT_PINGLESS |\
OBD_CONNECT_BULK_MBITS)
+#define MGS_CONNECT_SUPPORTED2 0
+
/* Features required for this version of the client to work with server */
#define CLIENT_CONNECT_MDT_REQD (OBD_CONNECT_IBITS | OBD_CONNECT_FID | \
OBD_CONNECT_FULL20)
imp_connect_tried:1,
/* connected but not FULL yet */
imp_connected:1;
- __u32 imp_connect_op;
- struct obd_connect_data imp_connect_data;
- __u64 imp_connect_flags_orig;
- int imp_connect_error;
-
- __u32 imp_msg_magic;
- __u32 imp_msghdr_flags; /* adjusted based on server capability */
-
- struct imp_at imp_at; /* adaptive timeout data */
- time_t imp_last_reply_time; /* for health check */
+ __u32 imp_connect_op;
+ struct obd_connect_data imp_connect_data;
+ __u64 imp_connect_flags_orig;
+ __u64 imp_connect_flags2_orig;
+ int imp_connect_error;
+
+ __u32 imp_msg_magic;
+ /* adjusted based on server capability */
+ __u32 imp_msghdr_flags;
+
+ /* adaptive timeout data */
+ struct imp_at imp_at;
+ time_t imp_last_reply_time; /* for health check */
};
/* import.c */
int obd_export_evict_by_nid(struct obd_device *obd, const char *nid);
int obd_export_evict_by_uuid(struct obd_device *obd, const char *uuid);
-int obd_connect_flags2str(char *page, int count, __u64 flags, char *sep);
+int obd_connect_flags2str(char *page, int count, __u64 flags, __u64 flags2,
+ const char *sep);
int obd_zombie_impexp_init(void);
void obd_zombie_impexp_stop(void);
bool is_mdc = false;
ENTRY;
- *exp = NULL;
+ *exp = NULL;
down_write(&cli->cl_sem);
if (cli->cl_conn_count > 0)
GOTO(out_sem, rc = -EALREADY);
- rc = class_connect(&conn, obd, cluuid);
- if (rc)
- GOTO(out_sem, rc);
+ rc = class_connect(&conn, obd, cluuid);
+ if (rc)
+ GOTO(out_sem, rc);
- cli->cl_conn_count++;
- *exp = class_conn2export(&conn);
+ cli->cl_conn_count++;
+ *exp = class_conn2export(&conn);
- LASSERT(obd->obd_namespace);
+ LASSERT(obd->obd_namespace);
- imp->imp_dlm_handle = conn;
- rc = ptlrpc_init_import(imp);
- if (rc != 0)
- GOTO(out_ldlm, rc);
+ imp->imp_dlm_handle = conn;
+ rc = ptlrpc_init_import(imp);
+ if (rc != 0)
+ GOTO(out_ldlm, rc);
- ocd = &imp->imp_connect_data;
- if (data) {
- *ocd = *data;
+ ocd = &imp->imp_connect_data;
+ if (data) {
+ *ocd = *data;
is_mdc = strncmp(imp->imp_obd->obd_type->typ_name,
LUSTRE_MDC_NAME, 3) == 0;
if (is_mdc)
data->ocd_connect_flags |= OBD_CONNECT_MULTIMODRPCS;
- imp->imp_connect_flags_orig = data->ocd_connect_flags;
- }
+ imp->imp_connect_flags_orig = data->ocd_connect_flags;
+ imp->imp_connect_flags2_orig = data->ocd_connect_flags2;
+ }
- rc = ptlrpc_connect_import(imp);
- if (rc != 0) {
+ rc = ptlrpc_connect_import(imp);
+ if (rc != 0) {
if (data && is_mdc)
data->ocd_connect_flags &= ~OBD_CONNECT_MULTIMODRPCS;
- LASSERT (imp->imp_state == LUSTRE_IMP_DISCON);
- GOTO(out_ldlm, rc);
- }
+ LASSERT(imp->imp_state == LUSTRE_IMP_DISCON);
+ GOTO(out_ldlm, rc);
+ }
LASSERT(*exp != NULL && (*exp)->exp_connection);
- if (data) {
- LASSERTF((ocd->ocd_connect_flags & data->ocd_connect_flags) ==
- ocd->ocd_connect_flags, "old "LPX64", new "LPX64"\n",
- data->ocd_connect_flags, ocd->ocd_connect_flags);
- data->ocd_connect_flags = ocd->ocd_connect_flags;
+ if (data) {
+ LASSERTF((ocd->ocd_connect_flags & data->ocd_connect_flags) ==
+ ocd->ocd_connect_flags, "old "LPX64", new "LPX64"\n",
+ data->ocd_connect_flags, ocd->ocd_connect_flags);
+ data->ocd_connect_flags = ocd->ocd_connect_flags;
/* clear the flag as it was not set and is not known
* by upper layers */
if (is_mdc)
data->ocd_connect_flags &= ~OBD_CONNECT_MULTIMODRPCS;
- }
+ }
- ptlrpc_pinger_add_import(imp);
+ ptlrpc_pinger_add_import(imp);
- EXIT;
+ EXIT;
- if (rc) {
+ if (rc) {
out_ldlm:
- cli->cl_conn_count--;
- class_disconnect(*exp);
- *exp = NULL;
- }
+ cli->cl_conn_count--;
+ class_disconnect(*exp);
+ *exp = NULL;
+ }
out_sem:
up_write(&cli->cl_sem);
OBD_CONNECT_OPEN_BY_FID |
OBD_CONNECT_DIR_STRIPE |
OBD_CONNECT_BULK_MBITS |
- OBD_CONNECT_SUBTREE;
+ OBD_CONNECT_SUBTREE |
+ OBD_CONNECT_FLAGS2;
+
+ data->ocd_connect_flags2 = 0;
#ifdef HAVE_LRU_RESIZE_SUPPORT
if (sbi->ll_flags & LL_SBI_LRU_RESIZE)
OBD_ALLOC_WAIT(buf, PAGE_CACHE_SIZE);
obd_connect_flags2str(buf, PAGE_CACHE_SIZE,
- valid ^ CLIENT_CONNECT_MDT_REQD, ",");
+ valid ^ CLIENT_CONNECT_MDT_REQD, 0, ",");
LCONSOLE_ERROR_MSG(0x170, "Server %s does not support "
"feature(s) needed for correct operation "
"of this client (%s). Please upgrade "
OBD_CONNECT_PINGLESS | OBD_CONNECT_LFSCK |
OBD_CONNECT_BULK_MBITS;
+ data->ocd_connect_flags2 = 0;
+
if (!OBD_FAIL_CHECK(OBD_FAIL_OSC_CONNECT_GRANT_PARAM))
data->ocd_connect_flags |= OBD_CONNECT_GRANT_PARAM;
- if (!OBD_FAIL_CHECK(OBD_FAIL_OSC_CONNECT_CKSUM)) {
- /* OBD_CONNECT_CKSUM should always be set, even if checksums are
- * disabled by default, because it can still be enabled on the
- * fly via /proc. As a consequence, we still need to come to an
- * agreement on the supported algorithms at connect time */
- data->ocd_connect_flags |= OBD_CONNECT_CKSUM;
+ if (!OBD_FAIL_CHECK(OBD_FAIL_OSC_CONNECT_CKSUM)) {
+ /* OBD_CONNECT_CKSUM should always be set, even if checksums are
+ * disabled by default, because it can still be enabled on the
+ * fly via /proc. As a consequence, we still need to come to an
+ * agreement on the supported algorithms at connect time */
+ data->ocd_connect_flags |= OBD_CONNECT_CKSUM;
if (OBD_FAIL_CHECK(OBD_FAIL_OSC_CKSUM_ADLER_ONLY))
data->ocd_cksum_types = OBD_CKSUM_ADLER;
else
data->ocd_cksum_types = cksum_types_supported_client();
- }
+ }
#ifdef HAVE_LRU_RESIZE_SUPPORT
- data->ocd_connect_flags |= OBD_CONNECT_LRU_RESIZE;
+ data->ocd_connect_flags |= OBD_CONNECT_LRU_RESIZE;
#endif
- if (sbi->ll_flags & LL_SBI_RMT_CLIENT)
- data->ocd_connect_flags |= OBD_CONNECT_RMT_CLIENT_FORCE;
+ if (sbi->ll_flags & LL_SBI_RMT_CLIENT)
+ data->ocd_connect_flags |= OBD_CONNECT_RMT_CLIENT_FORCE;
/* always ping even if server suppress_pings */
if (sbi->ll_flags & LL_SBI_ALWAYS_PING)
data->ocd_connect_flags &= ~OBD_CONNECT_PINGLESS;
- CDEBUG(D_RPCTRACE, "ocd_connect_flags: "LPX64" ocd_version: %d "
- "ocd_grant: %d\n", data->ocd_connect_flags,
- data->ocd_version, data->ocd_grant);
+ CDEBUG(D_RPCTRACE, "ocd_connect_flags: "LPX64" ocd_version: %d "
+ "ocd_grant: %d\n", data->ocd_connect_flags,
+ data->ocd_version, data->ocd_grant);
- obd->obd_upcall.onu_owner = &sbi->ll_lco;
- obd->obd_upcall.onu_upcall = cl_ocd_update;
+ obd->obd_upcall.onu_owner = &sbi->ll_lco;
+ obd->obd_upcall.onu_upcall = cl_ocd_update;
data->ocd_brw_size = DT_MAX_BRW_SIZE;
sb->s_op = &lustre_super_operations;
#if THREAD_SIZE >= 8192 /*b=17630*/
- sb->s_export_op = &lustre_export_operations;
+ sb->s_export_op = &lustre_export_operations;
#endif
/* make root inode
GOTO(out_lock_cn_cb, err);
}
- LASSERT(fid_is_sane(&sbi->ll_root_fid));
+ LASSERT(fid_is_sane(&sbi->ll_root_fid));
root = ll_iget(sb, cl_fid_build_ino(&sbi->ll_root_fid,
sbi->ll_flags & LL_SBI_32BIT_API),
&lmd);
- md_free_lustre_md(sbi->ll_md_exp, &lmd);
- ptlrpc_req_finished(request);
+ md_free_lustre_md(sbi->ll_md_exp, &lmd);
+ ptlrpc_req_finished(request);
if (IS_ERR(root)) {
#ifdef CONFIG_FS_POSIX_ACL
- if (lmd.posix_acl) {
- posix_acl_release(lmd.posix_acl);
- lmd.posix_acl = NULL;
- }
+ if (lmd.posix_acl) {
+ posix_acl_release(lmd.posix_acl);
+ lmd.posix_acl = NULL;
+ }
#endif
- err = IS_ERR(root) ? PTR_ERR(root) : -EBADF;
- root = NULL;
- CERROR("lustre_lite: bad iget4 for root\n");
- GOTO(out_root, err);
- }
+ err = IS_ERR(root) ? PTR_ERR(root) : -EBADF;
+ root = NULL;
+ CERROR("lustre_lite: bad iget4 for root\n");
+ GOTO(out_root, err);
+ }
#ifdef CONFIG_FS_POSIX_ACL
- if (sbi->ll_flags & LL_SBI_RMT_CLIENT) {
- rct_init(&sbi->ll_rct);
- et_init(&sbi->ll_et);
- }
+ if (sbi->ll_flags & LL_SBI_RMT_CLIENT) {
+ rct_init(&sbi->ll_rct);
+ et_init(&sbi->ll_et);
+ }
#endif
- checksum = sbi->ll_flags & LL_SBI_CHECKSUM;
- err = obd_set_info_async(NULL, sbi->ll_dt_exp, sizeof(KEY_CHECKSUM),
- KEY_CHECKSUM, sizeof(checksum), &checksum,
- NULL);
- cl_sb_init(sb);
+ checksum = sbi->ll_flags & LL_SBI_CHECKSUM;
+ err = obd_set_info_async(NULL, sbi->ll_dt_exp, sizeof(KEY_CHECKSUM),
+ KEY_CHECKSUM, sizeof(checksum), &checksum,
+ NULL);
+ cl_sb_init(sb);
err = obd_set_info_async(NULL, sbi->ll_dt_exp, sizeof(KEY_CACHE_SET),
KEY_CACHE_SET, sizeof(*sbi->ll_cache),
sb->s_root->d_op = &ll_d_ops;
#endif
- sbi->ll_sdev_orig = sb->s_dev;
+ sbi->ll_sdev_orig = sb->s_dev;
- /* We set sb->s_dev equal on all lustre clients in order to support
- * NFS export clustering. NFSD requires that the FSID be the same
- * on all clients. */
- /* s_dev is also used in lt_compare() to compare two fs, but that is
- * only a node-local comparison. */
- uuid = obd_get_uuid(sbi->ll_md_exp);
+ /* We set sb->s_dev equal on all lustre clients in order to support
+ * NFS export clustering. NFSD requires that the FSID be the same
+ * on all clients. */
+ /* s_dev is also used in lt_compare() to compare two fs, but that is
+ * only a node-local comparison. */
+ uuid = obd_get_uuid(sbi->ll_md_exp);
if (uuid != NULL)
sb->s_dev = get_uuid2int(uuid->uuid, strlen(uuid->uuid));
- if (data != NULL)
- OBD_FREE_PTR(data);
- if (osfs != NULL)
- OBD_FREE_PTR(osfs);
+ if (data != NULL)
+ OBD_FREE_PTR(data);
+ if (osfs != NULL)
+ OBD_FREE_PTR(osfs);
if (proc_lustre_fs_root != NULL) {
err = lprocfs_register_mountpoint(proc_lustre_fs_root, sb,
dt, md);
}
}
- RETURN(err);
+ RETURN(err);
out_root:
- if (root)
- iput(root);
+ if (root)
+ iput(root);
out_lock_cn_cb:
obd_fid_fini(sbi->ll_dt_exp->exp_obd);
out_dt:
- obd_disconnect(sbi->ll_dt_exp);
- sbi->ll_dt_exp = NULL;
+ obd_disconnect(sbi->ll_dt_exp);
+ sbi->ll_dt_exp = NULL;
out_md_fid:
obd_fid_fini(sbi->ll_md_exp->exp_obd);
out_md:
- obd_disconnect(sbi->ll_md_exp);
- sbi->ll_md_exp = NULL;
+ obd_disconnect(sbi->ll_md_exp);
+ sbi->ll_md_exp = NULL;
out:
- if (data != NULL)
- OBD_FREE_PTR(data);
- if (osfs != NULL)
- OBD_FREE_PTR(osfs);
- return err;
+ if (data != NULL)
+ OBD_FREE_PTR(data);
+ if (osfs != NULL)
+ OBD_FREE_PTR(osfs);
+ return err;
}
int ll_get_max_mdsize(struct ll_sb_info *sbi, int *lmmsize)
LASSERT(data != NULL);
data->ocd_connect_flags &= MDT_CONNECT_SUPPORTED;
+ data->ocd_connect_flags2 &= MDT_CONNECT_SUPPORTED2;
data->ocd_ibits_known &= MDS_INODELOCK_FULL;
if (!(data->ocd_connect_flags & OBD_CONNECT_MDS_MDS) &&
if (data != NULL) {
data->ocd_connect_flags &= MGS_CONNECT_SUPPORTED;
+ data->ocd_connect_flags2 &= MGS_CONNECT_SUPPORTED2;
data->ocd_version = LUSTRE_VERSION_CODE;
lexp->exp_connect_data = *data;
}
if (data != NULL) {
data->ocd_connect_flags &= MGS_CONNECT_SUPPORTED;
+ data->ocd_connect_flags2 &= MGS_CONNECT_SUPPORTED2;
data->ocd_version = LUSTRE_VERSION_CODE;
exp->exp_connect_data = *data;
}
#undef flag2str
static const char *obd_connect_names[] = {
+ /* flags names */
"read_only",
"lov_index",
"connect_from_mds",
"bulk_mbits",
"compact_obdo",
"second_flags",
+ /* flags2 names */
+ "file_secctx",
NULL
};
-static void obd_connect_seq_flags2str(struct seq_file *m, __u64 flags, char *sep)
+static void obd_connect_seq_flags2str(struct seq_file *m, __u64 flags,
+ __u64 flags2, const char *sep)
{
bool first = true;
- __u64 mask = 1;
+ __u64 mask;
int i;
- for (i = 0; obd_connect_names[i] != NULL; i++, mask <<= 1) {
+ for (i = 0, mask = 1; i < 64; i++, mask <<= 1) {
if (flags & mask) {
seq_printf(m, "%s%s",
first ? "" : sep, obd_connect_names[i]);
first = false;
}
}
- if (flags & ~(mask - 1))
+
+ if (flags & ~(mask - 1)) {
seq_printf(m, "%sunknown_"LPX64,
first ? "" : sep, flags & ~(mask - 1));
+ first = false;
+ }
+
+ if (!(flags & OBD_CONNECT_FLAGS2) || flags2 == 0)
+ return;
+
+ for (i = 64, mask = 1; obd_connect_names[i] != NULL; i++, mask <<= 1) {
+ if (flags2 & mask) {
+ seq_printf(m, "%s%s",
+ first ? "" : sep, obd_connect_names[i]);
+ first = false;
+ }
+ }
+
+ if (flags2 & ~(mask - 1)) {
+ seq_printf(m, "%sunknown2_"LPX64,
+ first ? "" : sep, flags2 & ~(mask - 1));
+ first = false;
+ }
}
-int obd_connect_flags2str(char *page, int count, __u64 flags, char *sep)
+int obd_connect_flags2str(char *page, int count, __u64 flags, __u64 flags2,
+ const char *sep)
{
- __u64 mask = 1;
+ __u64 mask;
int i, ret = 0;
- for (i = 0; obd_connect_names[i] != NULL; i++, mask <<= 1) {
+ for (i = 0, mask = 1; i < 64; i++, mask <<= 1) {
if (flags & mask)
ret += snprintf(page + ret, count - ret, "%s%s",
ret ? sep : "", obd_connect_names[i]);
}
+
if (flags & ~(mask - 1))
ret += snprintf(page + ret, count - ret,
"%sunknown_"LPX64,
ret ? sep : "", flags & ~(mask - 1));
+
+ if (!(flags & OBD_CONNECT_FLAGS2) || flags2 == 0)
+ return ret;
+
+ for (i = 64, mask = 1; obd_connect_names[i] != NULL; i++, mask <<= 1) {
+ if (flags2 & mask)
+ ret += snprintf(page + ret, count - ret, "%s%s",
+ ret ? sep : "", obd_connect_names[i]);
+ }
+
+ if (flags2 & ~(mask - 1))
+ ret += snprintf(page + ret, count - ret,
+ "%sunknown2_"LPX64,
+ ret ? sep : "", flags2 & ~(mask - 1));
+
return ret;
}
EXPORT_SYMBOL(obd_connect_flags2str);
obd2cli_tgt(obd),
ptlrpc_import_state_name(imp->imp_state));
obd_connect_seq_flags2str(m, imp->imp_connect_data.ocd_connect_flags,
+ imp->imp_connect_data.ocd_connect_flags2,
", ");
seq_printf(m, " ]\n");
obd_connect_data_seqprint(m, ocd);
{
struct obd_device *obd = data;
__u64 flags;
+ __u64 flags2;
LPROCFS_CLIMP_CHECK(obd);
flags = obd->u.cli.cl_import->imp_connect_data.ocd_connect_flags;
+ flags2 = obd->u.cli.cl_import->imp_connect_data.ocd_connect_flags2;
seq_printf(m, "flags="LPX64"\n", flags);
- obd_connect_seq_flags2str(m, flags, "\n");
+ seq_printf(m, "flags2="LPX64"\n", flags2);
+ obd_connect_seq_flags2str(m, flags, flags2, "\n");
seq_printf(m, "\n");
LPROCFS_CLIMP_EXIT(obd);
return 0;
struct obd_uuid *cluuid, struct obd_connect_data *data,
void *localdata)
{
- struct lustre_handle conn = { 0 };
- int rc;
-
- data->ocd_connect_flags &= ECHO_CONNECT_SUPPORTED;
- rc = class_connect(&conn, obd, cluuid);
- if (rc) {
- CERROR("can't connect %d\n", rc);
- return rc;
- }
- *exp = class_conn2export(&conn);
+ struct lustre_handle conn = { 0 };
+ int rc;
+
+ data->ocd_connect_flags &= ECHO_CONNECT_SUPPORTED;
+ data->ocd_connect_flags2 &= ECHO_CONNECT_SUPPORTED2;
+ rc = class_connect(&conn, obd, cluuid);
+ if (rc) {
+ CERROR("can't connect %d\n", rc);
+ return rc;
+ }
+ *exp = class_conn2export(&conn);
- return 0;
+ return 0;
}
static int echo_disconnect(struct obd_export *exp)
fed->fed_group = data->ocd_group;
data->ocd_connect_flags &= OST_CONNECT_SUPPORTED;
+ data->ocd_connect_flags2 &= OST_CONNECT_SUPPORTED2;
data->ocd_version = LUSTRE_VERSION_CODE;
/* Kindly make sure the SKIP_ORPHAN flag is from MDS. */
ocd->ocd_version = LUSTRE_VERSION_CODE;
imp->imp_connect_flags_orig = ocd->ocd_connect_flags;
+ imp->imp_connect_flags2_orig = ocd->ocd_connect_flags2;
rc = ptlrpc_connect_import(imp);
if (rc != 0) {
*ocd = *data;
imp->imp_connect_flags_orig = ocd->ocd_connect_flags;
+ imp->imp_connect_flags2_orig = ocd->ocd_connect_flags2;
ocd->ocd_version = LUSTRE_VERSION_CODE;
ocd->ocd_index = data->ocd_index;
- imp->imp_connect_flags_orig = ocd->ocd_connect_flags;
rc = ptlrpc_connect_import(imp);
if (rc) {
*/
int ptlrpc_connect_import(struct obd_import *imp)
{
- struct obd_device *obd = imp->imp_obd;
- int initial_connect = 0;
- int set_transno = 0;
- __u64 committed_before_reconnect = 0;
- struct ptlrpc_request *request;
- char *bufs[] = { NULL,
- obd2cli_tgt(imp->imp_obd),
- obd->obd_uuid.uuid,
- (char *)&imp->imp_dlm_handle,
- (char *)&imp->imp_connect_data };
- struct ptlrpc_connect_async_args *aa;
- int rc;
- ENTRY;
+ struct obd_device *obd = imp->imp_obd;
+ int initial_connect = 0;
+ int set_transno = 0;
+ __u64 committed_before_reconnect = 0;
+ struct ptlrpc_request *request;
+ char *bufs[] = { NULL,
+ obd2cli_tgt(imp->imp_obd),
+ obd->obd_uuid.uuid,
+ (char *)&imp->imp_dlm_handle,
+ (char *)&imp->imp_connect_data };
+ struct ptlrpc_connect_async_args *aa;
+ int rc;
+ ENTRY;
spin_lock(&imp->imp_lock);
if (imp->imp_state == LUSTRE_IMP_CLOSED) {
RETURN(-EALREADY);
}
- IMPORT_SET_STATE_NOLOCK(imp, LUSTRE_IMP_CONNECTING);
+ IMPORT_SET_STATE_NOLOCK(imp, LUSTRE_IMP_CONNECTING);
- imp->imp_conn_cnt++;
- imp->imp_resend_replay = 0;
+ imp->imp_conn_cnt++;
+ imp->imp_resend_replay = 0;
- if (!lustre_handle_is_used(&imp->imp_remote_handle))
- initial_connect = 1;
- else
- committed_before_reconnect = imp->imp_peer_committed_transno;
+ if (!lustre_handle_is_used(&imp->imp_remote_handle))
+ initial_connect = 1;
+ else
+ committed_before_reconnect = imp->imp_peer_committed_transno;
- set_transno = ptlrpc_first_transno(imp,
- &imp->imp_connect_data.ocd_transno);
+ set_transno = ptlrpc_first_transno(imp,
+ &imp->imp_connect_data.ocd_transno);
spin_unlock(&imp->imp_lock);
- rc = import_select_connection(imp);
- if (rc)
- GOTO(out, rc);
+ rc = import_select_connection(imp);
+ if (rc)
+ GOTO(out, rc);
rc = sptlrpc_import_sec_adapt(imp, NULL, NULL);
- if (rc)
- GOTO(out, rc);
+ if (rc)
+ GOTO(out, rc);
- /* Reset connect flags to the originally requested flags, in case
- * the server is updated on-the-fly we will get the new features. */
- imp->imp_connect_data.ocd_connect_flags = imp->imp_connect_flags_orig;
+ /* Reset connect flags to the originally requested flags, in case
+ * the server is updated on-the-fly we will get the new features. */
+ imp->imp_connect_data.ocd_connect_flags = imp->imp_connect_flags_orig;
+ imp->imp_connect_data.ocd_connect_flags2 = imp->imp_connect_flags2_orig;
/* Reset ocd_version each time so the server knows the exact versions */
imp->imp_connect_data.ocd_version = LUSTRE_VERSION_CODE;
- imp->imp_msghdr_flags &= ~MSGHDR_AT_SUPPORT;
- imp->imp_msghdr_flags &= ~MSGHDR_CKSUM_INCOMPAT18;
-
- rc = obd_reconnect(NULL, imp->imp_obd->obd_self_export, obd,
- &obd->obd_uuid, &imp->imp_connect_data, NULL);
- if (rc)
- GOTO(out, rc);
-
- request = ptlrpc_request_alloc(imp, &RQF_MDS_CONNECT);
- if (request == NULL)
- GOTO(out, rc = -ENOMEM);
-
- rc = ptlrpc_request_bufs_pack(request, LUSTRE_OBD_VERSION,
- imp->imp_connect_op, bufs, NULL);
- if (rc) {
- ptlrpc_request_free(request);
- GOTO(out, rc);
- }
+ imp->imp_msghdr_flags &= ~MSGHDR_AT_SUPPORT;
+ imp->imp_msghdr_flags &= ~MSGHDR_CKSUM_INCOMPAT18;
+
+ rc = obd_reconnect(NULL, imp->imp_obd->obd_self_export, obd,
+ &obd->obd_uuid, &imp->imp_connect_data, NULL);
+ if (rc)
+ GOTO(out, rc);
+
+ request = ptlrpc_request_alloc(imp, &RQF_MDS_CONNECT);
+ if (request == NULL)
+ GOTO(out, rc = -ENOMEM);
- /* Report the rpc service time to the server so that it knows how long
- * to wait for clients to join recovery */
- lustre_msg_set_service_time(request->rq_reqmsg,
- at_timeout2est(request->rq_timeout));
-
- /* The amount of time we give the server to process the connect req.
- * import_select_connection will increase the net latency on
- * repeated reconnect attempts to cover slow networks.
- * We override/ignore the server rpc completion estimate here,
- * which may be large if this is a reconnect attempt */
- request->rq_timeout = INITIAL_CONNECT_TIMEOUT;
- lustre_msg_set_timeout(request->rq_reqmsg, request->rq_timeout);
-
- request->rq_no_resend = request->rq_no_delay = 1;
- request->rq_send_state = LUSTRE_IMP_CONNECTING;
- /* Allow a slightly larger reply for future growth compatibility */
- req_capsule_set_size(&request->rq_pill, &RMF_CONNECT_DATA, RCL_SERVER,
- sizeof(struct obd_connect_data)+16*sizeof(__u64));
- ptlrpc_request_set_replen(request);
- request->rq_interpret_reply = ptlrpc_connect_interpret;
-
- CLASSERT(sizeof (*aa) <= sizeof (request->rq_async_args));
- aa = ptlrpc_req_async_args(request);
- memset(aa, 0, sizeof *aa);
-
- aa->pcaa_peer_committed = committed_before_reconnect;
- aa->pcaa_initial_connect = initial_connect;
-
- if (aa->pcaa_initial_connect) {
+ rc = ptlrpc_request_bufs_pack(request, LUSTRE_OBD_VERSION,
+ imp->imp_connect_op, bufs, NULL);
+ if (rc) {
+ ptlrpc_request_free(request);
+ GOTO(out, rc);
+ }
+
+ /* Report the rpc service time to the server so that it knows how long
+ * to wait for clients to join recovery */
+ lustre_msg_set_service_time(request->rq_reqmsg,
+ at_timeout2est(request->rq_timeout));
+
+ /* The amount of time we give the server to process the connect req.
+ * import_select_connection will increase the net latency on
+ * repeated reconnect attempts to cover slow networks.
+ * We override/ignore the server rpc completion estimate here,
+ * which may be large if this is a reconnect attempt */
+ request->rq_timeout = INITIAL_CONNECT_TIMEOUT;
+ lustre_msg_set_timeout(request->rq_reqmsg, request->rq_timeout);
+
+ request->rq_no_resend = request->rq_no_delay = 1;
+ request->rq_send_state = LUSTRE_IMP_CONNECTING;
+ /* Allow a slightly larger reply for future growth compatibility */
+ req_capsule_set_size(&request->rq_pill, &RMF_CONNECT_DATA, RCL_SERVER,
+ sizeof(struct obd_connect_data)+16*sizeof(__u64));
+ ptlrpc_request_set_replen(request);
+ request->rq_interpret_reply = ptlrpc_connect_interpret;
+
+ CLASSERT(sizeof(*aa) <= sizeof(request->rq_async_args));
+ aa = ptlrpc_req_async_args(request);
+ memset(aa, 0, sizeof *aa);
+
+ aa->pcaa_peer_committed = committed_before_reconnect;
+ aa->pcaa_initial_connect = initial_connect;
+
+ if (aa->pcaa_initial_connect) {
spin_lock(&imp->imp_lock);
imp->imp_replayable = 1;
spin_unlock(&imp->imp_lock);
- lustre_msg_add_op_flags(request->rq_reqmsg,
- MSG_CONNECT_INITIAL);
- }
+ lustre_msg_add_op_flags(request->rq_reqmsg,
+ MSG_CONNECT_INITIAL);
+ }
- if (set_transno)
- lustre_msg_add_op_flags(request->rq_reqmsg,
- MSG_CONNECT_TRANSNO);
+ if (set_transno)
+ lustre_msg_add_op_flags(request->rq_reqmsg,
+ MSG_CONNECT_TRANSNO);
DEBUG_REQ(D_RPCTRACE, request, "(re)connect request (timeout %d)",
request->rq_timeout);
/* check that server granted subset of flags we asked for. */
if ((ocd->ocd_connect_flags & imp->imp_connect_flags_orig) !=
ocd->ocd_connect_flags) {
- CERROR("%s: Server didn't granted asked subset of flags: "
- "asked="LPX64" grranted="LPX64"\n",
- imp->imp_obd->obd_name,imp->imp_connect_flags_orig,
+ CERROR("%s: Server didn't grant requested subset of flags: "
+ "asked="LPX64" granted="LPX64"\n",
+ imp->imp_obd->obd_name, imp->imp_connect_flags_orig,
ocd->ocd_connect_flags);
GOTO(out, rc = -EPROTO);
}
+ if ((ocd->ocd_connect_flags2 & imp->imp_connect_flags2_orig) !=
+ ocd->ocd_connect_flags2) {
+ CERROR("%s: Server didn't grant requested subset of flags2: "
+ "asked="LPX64" granted="LPX64"\n",
+ imp->imp_obd->obd_name, imp->imp_connect_flags2_orig,
+ ocd->ocd_connect_flags2);
+ GOTO(out, rc = -EPROTO);
+ }
+
if (!(imp->imp_connect_flags_orig & OBD_CONNECT_LIGHTWEIGHT) &&
(imp->imp_connect_flags_orig & OBD_CONNECT_MDS_MDS) &&
(imp->imp_connect_flags_orig & OBD_CONNECT_FID) &&
OBD_CONNECT_OBDOPACK);
LASSERTF(OBD_CONNECT_FLAGS2 == 0x8000000000000000ULL, "found 0x%.16llxULL\n",
OBD_CONNECT_FLAGS2);
+ LASSERTF(OBD_CONNECT2_FILE_SECCTX == 0x1ULL, "found 0x%.16llxULL\n",
+ OBD_CONNECT2_FILE_SECCTX);
LASSERTF(OBD_CKSUM_CRC32 == 0x00000001UL, "found 0x%.8xUL\n",
(unsigned)OBD_CKSUM_CRC32);
LASSERTF(OBD_CKSUM_ADLER == 0x00000002UL, "found 0x%.8xUL\n",
CHECK_DEFINE_64X(OBD_CONNECT_BULK_MBITS);
CHECK_DEFINE_64X(OBD_CONNECT_OBDOPACK);
CHECK_DEFINE_64X(OBD_CONNECT_FLAGS2);
+ CHECK_DEFINE_64X(OBD_CONNECT2_FILE_SECCTX);
CHECK_VALUE_X(OBD_CKSUM_CRC32);
CHECK_VALUE_X(OBD_CKSUM_ADLER);
OBD_CONNECT_OBDOPACK);
LASSERTF(OBD_CONNECT_FLAGS2 == 0x8000000000000000ULL, "found 0x%.16llxULL\n",
OBD_CONNECT_FLAGS2);
+ LASSERTF(OBD_CONNECT2_FILE_SECCTX == 0x1ULL, "found 0x%.16llxULL\n",
+ OBD_CONNECT2_FILE_SECCTX);
LASSERTF(OBD_CKSUM_CRC32 == 0x00000001UL, "found 0x%.8xUL\n",
(unsigned)OBD_CKSUM_CRC32);
LASSERTF(OBD_CKSUM_ADLER == 0x00000002UL, "found 0x%.8xUL\n",