struct dentry *dentry;
dentry = ll_lookup_one_len(name, parent, namelen);
- if (!IS_ERR(dentry) && dentry->d_inode == NULL) {
+ if (IS_ERR(dentry)) {
+ int rc = PTR_ERR(dentry);
+
+ if (rc != -ENOENT)
+ CERROR("Fail to find %.*s in %.*s (%lu/%u): rc = %d\n",
+ namelen, name, parent->d_name.len,
+ parent->d_name.name, parent->d_inode->i_ino,
+ parent->d_inode->i_generation, rc);
+
+ return dentry;
+ }
+
+ if (dentry->d_inode == NULL) {
dput(dentry);
return ERR_PTR(-ENOENT);
}
GOTO(cleanup_inode, rc);
} else {
if (memcmp(sf->sf_uuid, es->s_uuid, 16) != 0) {
+ struct obd_uuid *old_uuid;
+ struct obd_uuid *new_uuid;
+
+ OBD_ALLOC_PTR(old_uuid);
+ OBD_ALLOC_PTR(new_uuid);
+ if (old_uuid == NULL || new_uuid == NULL) {
+ CERROR("%.16s: UUID has been changed, but"
+ "failed to allocate RAM for report\n",
+ LDISKFS_SB(sb)->s_es->s_volume_name);
+ } else {
+ class_uuid_unparse(sf->sf_uuid, old_uuid);
+ class_uuid_unparse(es->s_uuid, new_uuid);
+ CERROR("%.16s: UUID has been changed from "
+ "%s to %s\n",
+ LDISKFS_SB(sb)->s_es->s_volume_name,
+ old_uuid->uuid, new_uuid->uuid);
+ }
osd_scrub_file_reset(scrub, es->s_uuid,SF_INCONSISTENT);
dirty = 1;
+ if (old_uuid != NULL)
+ OBD_FREE_PTR(old_uuid);
+ if (new_uuid != NULL)
+ OBD_FREE_PTR(new_uuid);
} else if (sf->sf_status == SS_SCANNING) {
sf->sf_status = SS_CRASHED;
dirty = 1;
}
facet_failover() {
+ local E2FSCK_ON_MDT0=false
+ if [ "$1" == "--fsck" ]; then
+ shift
+ [ $(facet_fstype $SINGLEMDS) == ldiskfs ] &&
+ E2FSCK_ON_MDT0=true
+ fi
+
local facets=$1
local sleep_time=$2
local -a affecteds
shutdown_facet $facet
done
+ $E2FSCK_ON_MDT0 && (run_e2fsck $(facet_active_host $SINGLEMDS) \
+ $(mdsdevname 1) "-n" || error "Running e2fsck")
+
for ((index=0; index<$total; index++)); do
facet=$(echo ${affecteds[index]} | tr -s " " | cut -d"," -f 1)
echo reboot facets: ${affecteds[index]}