Commit 70b749d4 authored by Fan Yong's avatar Fan Yong Committed by Greg Kroah-Hartman

staging/lustre/scrub: purge inconsistenct objects after OI scrub

When OI scrub repaired the found inconsistency, it needs to purge the
old object out of cache; otherwise, others may still use those cached
stale information.

Original patch adds functions in obdclass that is only used by server.
Drop that part. Only merge in error handling change.

Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3335
Lustre-change: http://review.whamcloud.com/6697Signed-off-by: default avatarFan Yong <fan.yong@intel.com>
Reviewed-by: default avatarAlex Zhuravlev <alexey.zhuravlev@intel.com>
Reviewed-by: default avatarAndreas Dilger <andreas.dilger@intel.com>
Reviewed-by: default avatarOleg Drokin <oleg.drokin@intel.com>
Signed-off-by: default avatarPeng Tao <tao.peng@emc.com>
Signed-off-by: default avatarAndreas Dilger <andreas.dilger@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 99a92265
...@@ -538,7 +538,7 @@ static struct lu_object *htable_lookup(struct lu_site *s, ...@@ -538,7 +538,7 @@ static struct lu_object *htable_lookup(struct lu_site *s,
__u64 ver = cfs_hash_bd_version_get(bd); __u64 ver = cfs_hash_bd_version_get(bd);
if (*version == ver) if (*version == ver)
return NULL; return ERR_PTR(-ENOENT);
*version = ver; *version = ver;
bkt = cfs_hash_bd_extra_get(s->ls_obj_hash, bd); bkt = cfs_hash_bd_extra_get(s->ls_obj_hash, bd);
...@@ -547,7 +547,7 @@ static struct lu_object *htable_lookup(struct lu_site *s, ...@@ -547,7 +547,7 @@ static struct lu_object *htable_lookup(struct lu_site *s,
hnode = cfs_hash_bd_peek_locked(s->ls_obj_hash, bd, (void *)f); hnode = cfs_hash_bd_peek_locked(s->ls_obj_hash, bd, (void *)f);
if (hnode == NULL) { if (hnode == NULL) {
lprocfs_counter_incr(s->ls_stats, LU_SS_CACHE_MISS); lprocfs_counter_incr(s->ls_stats, LU_SS_CACHE_MISS);
return NULL; return ERR_PTR(-ENOENT);
} }
h = container_of0(hnode, struct lu_object_header, loh_hash); h = container_of0(hnode, struct lu_object_header, loh_hash);
...@@ -651,7 +651,7 @@ static struct lu_object *lu_object_find_try(const struct lu_env *env, ...@@ -651,7 +651,7 @@ static struct lu_object *lu_object_find_try(const struct lu_env *env,
cfs_hash_bd_get_and_lock(hs, (void *)f, &bd, 1); cfs_hash_bd_get_and_lock(hs, (void *)f, &bd, 1);
o = htable_lookup(s, &bd, f, waiter, &version); o = htable_lookup(s, &bd, f, waiter, &version);
cfs_hash_bd_unlock(hs, &bd, 1); cfs_hash_bd_unlock(hs, &bd, 1);
if (o != NULL) if (!IS_ERR(o) || PTR_ERR(o) != -ENOENT)
return o; return o;
/* /*
...@@ -667,7 +667,7 @@ static struct lu_object *lu_object_find_try(const struct lu_env *env, ...@@ -667,7 +667,7 @@ static struct lu_object *lu_object_find_try(const struct lu_env *env,
cfs_hash_bd_lock(hs, &bd, 1); cfs_hash_bd_lock(hs, &bd, 1);
shadow = htable_lookup(s, &bd, f, waiter, &version); shadow = htable_lookup(s, &bd, f, waiter, &version);
if (likely(shadow == NULL)) { if (likely(IS_ERR(shadow) && PTR_ERR(shadow) == -ENOENT)) {
struct lu_site_bkt_data *bkt; struct lu_site_bkt_data *bkt;
bkt = cfs_hash_bd_extra_get(hs, &bd); bkt = cfs_hash_bd_extra_get(hs, &bd);
...@@ -2076,7 +2076,7 @@ void lu_object_assign_fid(const struct lu_env *env, struct lu_object *o, ...@@ -2076,7 +2076,7 @@ void lu_object_assign_fid(const struct lu_env *env, struct lu_object *o,
cfs_hash_bd_get_and_lock(hs, (void *)fid, &bd, 1); cfs_hash_bd_get_and_lock(hs, (void *)fid, &bd, 1);
shadow = htable_lookup(s, &bd, fid, &waiter, &version); shadow = htable_lookup(s, &bd, fid, &waiter, &version);
/* supposed to be unique */ /* supposed to be unique */
LASSERT(shadow == NULL); LASSERT(IS_ERR(shadow) && PTR_ERR(shadow) == -ENOENT);
*old = *fid; *old = *fid;
bkt = cfs_hash_bd_extra_get(hs, &bd); bkt = cfs_hash_bd_extra_get(hs, &bd);
cfs_hash_bd_add_locked(hs, &bd, &o->lo_header->loh_hash); cfs_hash_bd_add_locked(hs, &bd, &o->lo_header->loh_hash);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment