Whamcloud - gitweb
git://git.whamcloud.com
/
fs
/
lustre-release.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
LU-2915 lfsck: NO scrub for agent inode and remote parent
[fs/lustre-release.git]
/
lustre
/
osd-ldiskfs
/
osd_compat.c
diff --git
a/lustre/osd-ldiskfs/osd_compat.c
b/lustre/osd-ldiskfs/osd_compat.c
index
806fcc0
..
4794d78
100644
(file)
--- a/
lustre/osd-ldiskfs/osd_compat.c
+++ b/
lustre/osd-ldiskfs/osd_compat.c
@@
-27,7
+27,7
@@
* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*
* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*
- * Copyright (c) 2012, Intel Corporation.
+ * Copyright (c) 2012,
2013,
Intel Corporation.
*/
/*
* This file is part of Lustre, http://www.lustre.org/
*/
/*
* This file is part of Lustre, http://www.lustre.org/
@@
-192,6
+192,7
@@
static int osd_mdt_init(const struct lu_env *env, struct osd_device *dev)
if (IS_ERR(d))
GOTO(cleanup, rc = PTR_ERR(d));
if (IS_ERR(d))
GOTO(cleanup, rc = PTR_ERR(d));
+ ldiskfs_set_inode_state(d->d_inode, LDISKFS_STATE_LUSTRE_NO_OI);
omm->omm_remote_parent = d;
/* Set LMA for remote parent inode */
omm->omm_remote_parent = d;
/* Set LMA for remote parent inode */
@@
-255,6
+256,8
@@
int osd_add_to_remote_parent(const struct lu_env *env, struct osd_device *osd,
mutex_lock(&parent->d_inode->i_mutex);
rc = osd_ldiskfs_add_entry(oh->ot_handle, dentry, obj->oo_inode,
NULL);
mutex_lock(&parent->d_inode->i_mutex);
rc = osd_ldiskfs_add_entry(oh->ot_handle, dentry, obj->oo_inode,
NULL);
+ CDEBUG(D_INODE, "%s: add %s:%lu to remote parent %lu.\n", osd_name(osd),
+ name, obj->oo_inode->i_ino, parent->d_inode->i_ino);
LASSERTF(parent->d_inode->i_nlink > 1, "%s: %lu nlink %d",
osd_name(osd), parent->d_inode->i_ino,
parent->d_inode->i_nlink);
LASSERTF(parent->d_inode->i_nlink > 1, "%s: %lu nlink %d",
osd_name(osd), parent->d_inode->i_ino,
parent->d_inode->i_nlink);
@@
-297,6
+300,8
@@
int osd_delete_from_remote_parent(const struct lu_env *env,
mutex_unlock(&parent->d_inode->i_mutex);
RETURN(-ENOENT);
}
mutex_unlock(&parent->d_inode->i_mutex);
RETURN(-ENOENT);
}
+ CDEBUG(D_INODE, "%s: el %s:%lu to remote parent %lu.\n", osd_name(osd),
+ name, obj->oo_inode->i_ino, parent->d_inode->i_ino);
rc = ldiskfs_delete_entry(oh->ot_handle, parent->d_inode, de, bh);
LASSERTF(parent->d_inode->i_nlink > 1, "%s: %lu nlink %d",
osd_name(osd), parent->d_inode->i_ino,
rc = ldiskfs_delete_entry(oh->ot_handle, parent->d_inode, de, bh);
LASSERTF(parent->d_inode->i_nlink > 1, "%s: %lu nlink %d",
osd_name(osd), parent->d_inode->i_ino,
@@
-305,6
+310,12
@@
int osd_delete_from_remote_parent(const struct lu_env *env,
mark_inode_dirty(parent->d_inode);
mutex_unlock(&parent->d_inode->i_mutex);
brelse(bh);
mark_inode_dirty(parent->d_inode);
mutex_unlock(&parent->d_inode->i_mutex);
brelse(bh);
+
+ /* Get rid of REMOTE_PARENT flag from incompat */
+ lma->lma_incompat &= ~LMAI_REMOTE_PARENT;
+ lustre_lma_swab(lma);
+ rc = __osd_xattr_set(oti, obj->oo_inode, XATTR_NAME_LMA, lma,
+ sizeof(*lma), XATTR_REPLACE);
RETURN(rc);
}
RETURN(rc);
}
@@
-691,16
+702,16
@@
int osd_obj_map_lookup(struct osd_thread_info *info, struct osd_device *dev,
LASSERT(map);
LASSERT(map->om_root);
LASSERT(map);
LASSERT(map->om_root);
- fid_
ostid_pack
(fid, ostid);
- osd_seq = osd_seq_load(dev, ostid
->oi_seq
);
+ fid_
to_ostid
(fid, ostid);
+ osd_seq = osd_seq_load(dev, ostid
_seq(ostid)
);
if (IS_ERR(osd_seq))
RETURN(PTR_ERR(osd_seq));
if (IS_ERR(osd_seq))
RETURN(PTR_ERR(osd_seq));
- dirn = ostid
->oi_id
& (osd_seq->oos_subdir_count - 1);
+ dirn = ostid
_id(ostid)
& (osd_seq->oos_subdir_count - 1);
d_seq = osd_seq->oos_dirs[dirn];
LASSERT(d_seq);
d_seq = osd_seq->oos_dirs[dirn];
LASSERT(d_seq);
- osd_oid_name(name, fid, ostid
->oi_id
);
+ osd_oid_name(name, fid, ostid
_id(ostid)
);
child = &info->oti_child_dentry;
child->d_parent = d_seq;
child = &info->oti_child_dentry;
child->d_parent = d_seq;
@@
-746,17
+757,17
@@
int osd_obj_map_insert(struct osd_thread_info *info,
LASSERT(map);
/* map fid to seq:objid */
LASSERT(map);
/* map fid to seq:objid */
- fid_
ostid_pack
(fid, ostid);
+ fid_
to_ostid
(fid, ostid);
- osd_seq = osd_seq_load(osd, ostid
->oi_seq
);
+ osd_seq = osd_seq_load(osd, ostid
_seq(ostid)
);
if (IS_ERR(osd_seq))
RETURN(PTR_ERR(osd_seq));
if (IS_ERR(osd_seq))
RETURN(PTR_ERR(osd_seq));
- dirn = ostid
->oi_id
& (osd_seq->oos_subdir_count - 1);
+ dirn = ostid
_id(ostid)
& (osd_seq->oos_subdir_count - 1);
d = osd_seq->oos_dirs[dirn];
LASSERT(d);
d = osd_seq->oos_dirs[dirn];
LASSERT(d);
- osd_oid_name(name, fid, ostid
->oi_id
);
+ osd_oid_name(name, fid, ostid
_id(ostid)
);
rc = osd_obj_add_entry(info, osd, d, name, id, th);
RETURN(rc);
rc = osd_obj_add_entry(info, osd, d, name, id, th);
RETURN(rc);
@@
-777,17
+788,17
@@
int osd_obj_map_delete(struct osd_thread_info *info, struct osd_device *osd,
LASSERT(map);
/* map fid to seq:objid */
LASSERT(map);
/* map fid to seq:objid */
- fid_
ostid_pack
(fid, ostid);
+ fid_
to_ostid
(fid, ostid);
- osd_seq = osd_seq_load(osd, ostid
->oi_seq
);
+ osd_seq = osd_seq_load(osd, ostid
_seq(ostid)
);
if (IS_ERR(osd_seq))
GOTO(cleanup, rc = PTR_ERR(osd_seq));
if (IS_ERR(osd_seq))
GOTO(cleanup, rc = PTR_ERR(osd_seq));
- dirn = ostid
->oi_id
& (osd_seq->oos_subdir_count - 1);
+ dirn = ostid
_id(ostid)
& (osd_seq->oos_subdir_count - 1);
d = osd_seq->oos_dirs[dirn];
LASSERT(d);
d = osd_seq->oos_dirs[dirn];
LASSERT(d);
- osd_oid_name(name, fid, ostid
->oi_id
);
+ osd_oid_name(name, fid, ostid
_id(ostid)
);
rc = osd_obj_del_entry(info, osd, d, name, th);
cleanup:
RETURN(rc);
rc = osd_obj_del_entry(info, osd, d, name, th);
cleanup:
RETURN(rc);