RETURN(err);
}
- if (pag) {
+ /* FIXME Because of the async nature of file i/o, we never know
+ * who is actually dirty the pages; and any process have chance
+ * to trigger dirty-flushing within its own process context. So
+ * for simplicity we simply use root's credential, we suppose root
+ * always have credential.
+ */
+ if (pag)
sec_flags = PTLRPC_SEC_FL_PAG;
- err = obd_set_info(obd->obd_self_export,
- strlen("sec_flags"), "sec_flags",
- sizeof(sec_flags), &sec_flags);
- if (err) {
- OBD_FREE(data, sizeof(*data));
- RETURN(err);
- }
+ else
+ sec_flags = PTLRPC_SEC_FL_OSS;
+
+ err = obd_set_info(obd->obd_self_export,
+ strlen("sec_flags"), "sec_flags",
+ sizeof(sec_flags), &sec_flags);
+ if (err) {
+ OBD_FREE(data, sizeof(*data));
+ RETURN(err);
}
err = obd_connect(&dt_conn, obd, &sbi->ll_sb_uuid, data, 0);
if (err)
GOTO(out_lmv, err);
+ /*connect GSS*/
err = lustre_init_crypto(sb, gkc, data, async);
if (err) {
CERROR("Could not connect to GSS err %d\n", err);
err = 0;
}
- /*connect GSS*/
+
err = lustre_init_root_inode(sb);
if (err)
GOTO(out_gks, err);
ll_gns_del_timer(sbi);
ll_close_thread_stop(sbi->ll_lcq);
- lustre_destroy_crypto(sb);
-
list_del(&sbi->ll_conn_chain);
obd_disconnect(sbi->ll_dt_exp, 0);
+
+ lustre_destroy_crypto(sb);
lprocfs_unregister_mountpoint(sbi);
if (sbi->ll_proc_root) {
lli->lli_audit_mask = AUDIT_OFF;
lli->lli_key_info = NULL;
init_waitqueue_head(&lli->lli_dirty_wait);
+ lli->lli_io_epoch = 0;
+ INIT_LIST_HEAD(&lli->lli_capas);
}
int ll_fill_super(struct super_block *sb, void *data, int silent)
cfg.cfg_instance = sbi->ll_instance;
cfg.cfg_uuid = sbi->ll_sb_uuid;
cfg.cfg_local_nid = lmd->lmd_local_nid;
+ cfg.cfg_flags |= CFG_MODIFY_UUID_FL;
err = lustre_process_log(lmd, lmd->lmd_profile, &cfg, 0);
if (err < 0) {
CERROR("Unable to process log: %s\n", lmd->lmd_profile);
}
if (sbi->ll_instance != NULL) {
+ cfg.cfg_flags |= CFG_MODIFY_UUID_FL;
cfg.cfg_instance = sbi->ll_instance;
cfg.cfg_uuid = sbi->ll_sb_uuid;
struct lustre_id id;
struct ll_inode_info *lli = ll_i2info(inode);
struct ll_sb_info *sbi = ll_i2sbi(inode);
+ struct obd_capa *ocapa, *tmp;
ENTRY;
CDEBUG(D_VFSTRACE, "VFS Op:inode=%lu/%u(%p)\n", inode->i_ino,
(struct lov_stripe_md **) &lli->lli_mea);
lli->lli_mea = NULL;
}
+
+ LASSERT(sbi->ll_crypto_info != NULL);
ll_crypto_destroy_inode_key(inode);
+
if (lli->lli_symlink_name) {
OBD_FREE(lli->lli_symlink_name,
strlen(lli->lli_symlink_name) + 1);
lli->lli_remote_acl = NULL;
}
- if (lli->lli_trunc_capa) {
- OBD_FREE(lli->lli_trunc_capa, sizeof(struct lustre_capa));
- lli->lli_trunc_capa = NULL;
- }
+ list_for_each_entry_safe(ocapa, tmp, &lli->lli_capas, u.client.lli_list)
+ capa_put(ocapa);
+ LASSERT(!mapping_has_pages(inode->i_mapping));
lli->lli_inode_magic = LLI_INODE_DEAD;
+
EXIT;
}
struct ll_sb_info *sbi = ll_i2sbi(inode);
struct ptlrpc_request *request = NULL;
struct mdc_op_data *op_data;
- struct lustre_capa *trunc_capa = NULL;
int ia_valid = attr->ia_valid;
int err, rc = 0;
ENTRY;
RETURN(-ENOMEM);
ll_inode2mdc_data(op_data, inode, (OBD_MD_FLID | OBD_MD_MEA));
- if (ia_valid & (ATTR_UID | ATTR_GID)) {
+ if (ia_valid & (ATTR_UID | ATTR_GID | ATTR_MODE)) {
rc = ll_crypto_get_mac(inode, attr, NULL, 0, &key,
&key_size);
+ if (rc) {
+ CERROR("can not get right mac, rc=%d\n", rc);
+ if (key && key_size)
+ OBD_FREE(key, key_size);
+ RETURN(rc);
+ }
}
rc = md_setattr(sbi->ll_md_exp, op_data,
attr, key, key_size, NULL, 0, NULL,
}
if (attr->ia_valid & ATTR_SIZE) {
- /* XXX: hack for truncate capa */
- rc = mdc_req2lustre_capa(request, 0, &trunc_capa);
+ rc = ll_set_trunc_capa(request, 0, inode);
if (rc) {
ptlrpc_req_finished(request);
RETURN(rc);
}
-
- spin_lock(&lli->lli_lock);
- if (trunc_capa) {
- if (lli->lli_trunc_capa)
- OBD_FREE(lli->lli_trunc_capa,
- sizeof(*trunc_capa));
- lli->lli_trunc_capa = trunc_capa;
- }
- spin_unlock(&lli->lli_lock);
}
/* We call inode_setattr to adjust timestamps, but we first
obdo_from_inode(oa, inode, OBD_MD_FLTYPE | OBD_MD_FLATIME |
OBD_MD_FLMTIME | OBD_MD_FLCTIME);
- rc = obd_setattr(sbi->ll_dt_exp, oa, lsm, NULL);
+ rc = obd_setattr(sbi->ll_dt_exp, oa, lsm, NULL, NULL);
obdo_free(oa);
if (rc)
CERROR("obd_setattr fails: rc = %d\n", rc);
oa->o_valid = OBD_MD_FLID | OBD_MD_FLFLAGS | OBD_MD_FLGROUP
| OBD_MD_FLIFID;
- rc = obd_setattr(sbi->ll_dt_exp, oa, lsm, NULL);
+ rc = obd_setattr(sbi->ll_dt_exp, oa, lsm, NULL, NULL);
obdo_free(oa);
if (rc) {
if (rc != -EPERM && rc != -EACCES)