memcpy(ent->lde_name, name, len);
result = mdd_append_attrs(env, mdd, attr, iops, it, ent);
+ if (result == -ESTALE)
+ goto next;
if (result != 0)
goto out;
} else {
next:
result = iops->next(env, it);
+ if (result == -ESTALE)
+ goto next;
} while (result == 0);
out:
dentry->d_inode = inode;
LASSERT(dentry->d_inode->i_sb == osd_sb(dev));
} else {
- CERROR("Error getting inode for ino =%d", id->oii_ino);
RETURN((struct dt_rec *) PTR_ERR(inode));
}
CERROR("stale inode\n");
iput(inode);
inode = ERR_PTR(-ESTALE);
+ } else if (inode->i_nlink == 0) {
+ /* due to parallel readdir and unlink,
+ * we can have dead inode here. */
+ make_bad_inode(inode);
+ iput(inode);
+ inode = ERR_PTR(-ESTALE);
}
return inode;