We should not add the FID mapping in the OI file for local object.
Otherwise it will cause OI lookup to return non-exist local object
when the local object lost for system crash, and it also prevents
new local object to be created, and then causes the server cannot
mountup.
This issue has been fixed in OI scrub project, which will be back
ported to lustre-2.1 soon. This is a temporary patch to allow the
current lustre-2.1 to be workable.
Signed-off-by: Fan Yong <yong.fan@whamcloud.com>
Change-Id: Ibe2861818aaef3842605fb7d4e24cc02dad22104
Reviewed-on: http://review.whamcloud.com/4395
Tested-by: Hudson
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
-static inline int fid_is_oi_fid(const struct lu_fid *fid)
-{
- /* We need to filter-out oi obj's fid. As we can not store it, while
- * oi-index create operation.
- */
- return (unlikely(fid_seq(fid) == FID_SEQ_LOCAL_FILE &&
- fid_oid(fid) == OSD_OI_FID_16_OID));
-}
-
int osd_oi_lookup(struct osd_thread_info *info, struct osd_oi *oi,
const struct lu_fid *fid, struct osd_inode_id *id)
{
struct lu_fid *oi_fid = &info->oti_fid;
int rc;
int osd_oi_lookup(struct osd_thread_info *info, struct osd_oi *oi,
const struct lu_fid *fid, struct osd_inode_id *id)
{
struct lu_fid *oi_fid = &info->oti_fid;
int rc;
+ if (fid_seq(fid) == FID_SEQ_LOCAL_FILE)
+ return -ENOENT;
+
if (osd_fid_is_igif(fid)) {
lu_igif_to_id(fid, id);
rc = 0;
if (osd_fid_is_igif(fid)) {
lu_igif_to_id(fid, id);
rc = 0;
struct dt_object *idx;
const struct dt_key *key;
struct dt_object *idx;
const struct dt_key *key;
- if (fid_is_oi_fid(fid))
- return -ENOENT;
-
idx = oi->oi_dir;
fid_cpu_to_be(oi_fid, fid);
key = (struct dt_key *) oi_fid;
idx = oi->oi_dir;
fid_cpu_to_be(oi_fid, fid);
key = (struct dt_key *) oi_fid;
struct osd_inode_id *id;
const struct dt_key *key;
struct osd_inode_id *id;
const struct dt_key *key;
- if (osd_fid_is_igif(fid))
- return 0;
+ if (fid_seq(fid) == FID_SEQ_LOCAL_FILE)
+ return 0;
- if (fid_is_oi_fid(fid))
+ if (osd_fid_is_igif(fid))
return 0;
idx = oi->oi_dir;
return 0;
idx = oi->oi_dir;