return -ENOENT;
}
+ /* If the object has been destroyed, then do not get LMVEA, because
+ * it needs to load stripes from the iteration of the master object,
+ * and it will cause problem if master object has been destroyed, see
+ * LU-6427 */
+ if (unlikely((mdd_obj->mod_flags & DEAD_OBJ) &&
+ !(mdd_obj->mod_flags & ORPHAN_OBJ) &&
+ strcmp(name, XATTR_NAME_LMV) == 0))
+ RETURN(-ENOENT);
+
/* If the object has been delete from the namespace, then
* get linkEA should return -ENOENT as well */
if (unlikely((mdd_obj->mod_flags & (DEAD_OBJ | ORPHAN_OBJ)) &&
/* not needed in the cache anymore */
set_bit(LU_OBJECT_HEARD_BANSHEE, &dt->do_lu.lo_header->loh_flags);
+ obj->oo_destroyed = 1;
RETURN(0);
}
struct dentry *obj_dentry;
ENTRY;
- if (!dt_object_exists(dt))
+ if (!dt_object_exists(dt) || obj->oo_destroyed)
RETURN(ERR_PTR(-ENOENT));
OBD_SLAB_ALLOC_PTR_GFP(oie, osd_itea_cachep, GFP_NOFS);
struct osd_directory *oo_dir;
/** protects inode attributes. */
spinlock_t oo_guard;
+
+ __u32 oo_destroyed:1;
/**
* Following two members are used to indicate the presence of dot and
* dotdot in the given directory. This is required for interop mode
int rc;
ENTRY;
+ if (obj->oo_destroyed)
+ RETURN(ERR_PTR(-ENOENT));
+
LASSERT(lu_object_exists(lo));
LASSERT(obj->oo_db);
LASSERT(osd_object_is_zap(obj->oo_db));
uint64_t oo_xattr;
enum osd_destroy_type oo_destroy;
+ __u32 oo_destroyed:1;
/* record size for index file */
unsigned char oo_keysize;
unsigned char oo_recsize;
out:
/* not needed in the cache anymore */
set_bit(LU_OBJECT_HEARD_BANSHEE, &dt->do_lu.lo_header->loh_flags);
-
+ if (rc == 0)
+ obj->oo_destroyed = 1;
RETURN (0);
}
}
run_test 82 "fsetxattr and fgetxattr on orphan files"
+test_83() {
+ [ $MDSCOUNT -lt 2 ] && skip "needs >= 2 MDTs" && return
+ local pid1
+ local pid2
+
+ (
+ cd $DIR1
+ while true; do
+ $LFS mkdir -i1 -c2 $tdir
+ rmdir $tdir
+ done
+ ) &
+ pid1=$!
+ echo "start pid $pid1 to create/unlink striped directory"
+
+ # Access the directory at the same time
+ (
+ cd $DIR2
+ while true; do
+ stat $tdir > /dev/null 2>&1
+ done
+ ) &
+ pid2=$!
+ echo "start pid $pid2 to stat striped directory"
+
+ sleep 120
+ kill $pid1 $pid2
+ wait $pid1 $pid2
+
+ return 0
+}
+run_test 83 "access striped directory while it is being created/unlinked"
+
log "cleanup: ======================================================"
[ "$(mount | grep $MOUNT2)" ] && umount $MOUNT2