else if (unlikely(OBD_FAIL_PRECHECK(OBD_FAIL_MDS_PDO_LOCK)) &&
lh->mlh_pdo_hash != 0 &&
(lh->mlh_reg_mode == LCK_PW || lh->mlh_reg_mode == LCK_EX)) {
- OBD_FAIL_TIMEOUT(OBD_FAIL_MDS_PDO_LOCK, 10);
+ OBD_FAIL_TIMEOUT(OBD_FAIL_MDS_PDO_LOCK, 15);
}
RETURN(rc);
return 0;
}
-static void fsoptions_to_mdt_flags(struct mdt_device *m, char *options)
-{
- char *p = options;
-
- m->mdt_opts.mo_mds_capa = 1;
- m->mdt_opts.mo_oss_capa = 1;
-#ifdef CONFIG_FS_POSIX_ACL
- /* ACLs should be enabled by default (b=13829) */
- m->mdt_opts.mo_acl = 1;
- LCONSOLE_INFO("Enabling ACL\n");
-#else
- m->mdt_opts.mo_acl = 0;
- LCONSOLE_INFO("Disabling ACL\n");
-#endif
-
- if (!options)
- return;
-
- while (*options) {
- int len;
-
- while (*p && *p != ',')
- p++;
-
- len = p - options;
- if ((len == sizeof("user_xattr") - 1) &&
- (memcmp(options, "user_xattr", len) == 0)) {
- m->mdt_opts.mo_user_xattr = 1;
- LCONSOLE_INFO("Enabling user_xattr\n");
- } else if ((len == sizeof("nouser_xattr") - 1) &&
- (memcmp(options, "nouser_xattr", len) == 0)) {
- m->mdt_opts.mo_user_xattr = 0;
- LCONSOLE_INFO("Disabling user_xattr\n");
- } else if ((len == sizeof("noacl") - 1) &&
- (memcmp(options, "noacl", len) == 0)) {
- m->mdt_opts.mo_acl = 0;
- LCONSOLE_INFO("Disabling ACL\n");
- }
-
- if (!*p)
- break;
-
- options = ++p;
- }
-}
-
int mdt_postrecov(const struct lu_env *, struct mdt_device *);
static int mdt_init0(const struct lu_env *env, struct mdt_device *m,
struct lu_site *s;
struct md_site *mite;
const char *identity_upcall = "NONE";
-#ifdef HAVE_QUOTA_SUPPORT
struct md_device *next;
-#endif
int rc;
int node_id;
+ mntopt_t mntopts;
ENTRY;
md_device_init(&m->mdt_md_dev, ldt);
m->mdt_max_cookiesize = sizeof(struct llog_cookie);
m->mdt_som_conf = 0;
- m->mdt_opts.mo_user_xattr = 0;
- m->mdt_opts.mo_acl = 0;
m->mdt_opts.mo_cos = MDT_COS_DEFAULT;
lmi = server_get_mount_2(dev);
if (lmi == NULL) {
RETURN(-EFAULT);
} else {
lsi = s2lsi(lmi->lmi_sb);
- fsoptions_to_mdt_flags(m, lsi->lsi_lmd->lmd_opts);
/* CMD is supported only in IAM mode */
ldd = lsi->lsi_ldd;
LASSERT(num);
cfs_spin_lock_init(&m->mdt_ioepoch_lock);
m->mdt_opts.mo_compat_resname = 0;
+ m->mdt_opts.mo_mds_capa = 1;
+ m->mdt_opts.mo_oss_capa = 1;
m->mdt_capa_timeout = CAPA_TIMEOUT;
m->mdt_capa_alg = CAPA_HMAC_ALG_SHA1;
m->mdt_ck_timeout = CAPA_KEY_TIMEOUT;
/* set obd_namespace for compatibility with old code */
obd->obd_namespace = m->mdt_namespace;
- /* XXX: to support suppgid for ACL, we enable identity_upcall
- * by default, otherwise, maybe got unexpected -EACCESS. */
- if (m->mdt_opts.mo_acl)
- identity_upcall = MDT_IDENTITY_UPCALL_PATH;
-
- m->mdt_identity_cache = upcall_cache_init(obd->obd_name, identity_upcall,
- &mdt_identity_upcall_cache_ops);
- if (IS_ERR(m->mdt_identity_cache)) {
- rc = PTR_ERR(m->mdt_identity_cache);
- m->mdt_identity_cache = NULL;
- GOTO(err_free_ns, rc);
- }
-
cfs_timer_init(&m->mdt_ck_timer, mdt_ck_timer_callback, m);
rc = mdt_ck_thread_start(m);
mdt_adapt_sptlrpc_conf(obd, 1);
-#ifdef HAVE_QUOTA_SUPPORT
next = m->mdt_child;
+#ifdef HAVE_QUOTA_SUPPORT
rc = next->md_ops->mdo_quota.mqo_setup(env, next, lmi->lmi_mnt);
if (rc)
GOTO(err_llog_cleanup, rc);
server_put_mount_2(dev, lmi->lmi_mnt);
lmi = NULL;
+ rc = next->md_ops->mdo_iocontrol(env, next, OBD_IOC_GET_MNTOPT, 0,
+ &mntopts);
+ if (rc)
+ GOTO(err_quota, rc);
+
+ if (mntopts & MNTOPT_USERXATTR)
+ m->mdt_opts.mo_user_xattr = 1;
+ else
+ m->mdt_opts.mo_user_xattr = 0;
+
+ if (mntopts & MNTOPT_ACL)
+ m->mdt_opts.mo_acl = 1;
+ else
+ m->mdt_opts.mo_acl = 0;
+
+ /* XXX: to support suppgid for ACL, we enable identity_upcall
+ * by default, otherwise, maybe got unexpected -EACCESS. */
+ if (m->mdt_opts.mo_acl)
+ identity_upcall = MDT_IDENTITY_UPCALL_PATH;
+
+ m->mdt_identity_cache = upcall_cache_init(obd->obd_name,identity_upcall,
+ &mdt_identity_upcall_cache_ops);
+ if (IS_ERR(m->mdt_identity_cache)) {
+ rc = PTR_ERR(m->mdt_identity_cache);
+ m->mdt_identity_cache = NULL;
+ GOTO(err_quota, rc);
+ }
+
target_recovery_init(&m->mdt_lut, mdt_recovery_handle);
rc = mdt_start_ptlrpc_service(m);
mdt_stop_ptlrpc_service(m);
err_recovery:
target_recovery_fini(obd);
+ upcall_cache_cleanup(m->mdt_identity_cache);
+ m->mdt_identity_cache = NULL;
+err_quota:
#ifdef HAVE_QUOTA_SUPPORT
next->md_ops->mdo_quota.mqo_cleanup(env, next);
#endif
cfs_timer_disarm(&m->mdt_ck_timer);
mdt_ck_thread_stop(m);
err_free_ns:
- upcall_cache_cleanup(m->mdt_identity_cache);
- m->mdt_identity_cache = NULL;
ldlm_namespace_free(m->mdt_namespace, NULL, 0);
obd->obd_namespace = m->mdt_namespace = NULL;
err_fini_seq:
/* context key: mdt_thread_key */
LU_CONTEXT_KEY_DEFINE(mdt, LCT_MD_THREAD);
-/* context key constructor/destructor: mdt_txn_key_init, mdt_txn_key_fini */
-LU_KEY_INIT_FINI(mdt_txn, struct mdt_txn_info);
-
-struct lu_context_key mdt_txn_key = {
- .lct_tags = LCT_TX_HANDLE,
- .lct_init = mdt_txn_key_init,
- .lct_fini = mdt_txn_key_fini
-};
-
struct md_ucred *mdt_ucred(const struct mdt_thread_info *info)
{
return md_ucred(info->mti_env);
}
/* type constructor/destructor: mdt_type_init, mdt_type_fini */
-LU_TYPE_INIT_FINI(mdt, &mdt_thread_key, &mdt_txn_key);
+LU_TYPE_INIT_FINI(mdt, &mdt_thread_key);
static struct lu_device_type_operations mdt_device_type_ops = {
.ldto_init = mdt_type_init,