unsigned long ino, __u32 generation,
__u32 mode)
{
- struct inode *inode;
+ struct inode *inode, *odf_inode;
struct dentry *result;
int err = 0;
if (ino == 0 || mode == 0)
return ERR_PTR(-ESTALE);
+ /*
+ * Consult the ODF to check on the inode's health. Specially
+ * useful when the client requests an inode which was deleted.
+ * Since the ODF is our persistent store, atleast for attributes,
+ * we refer to it.
+ */
+ odf_inode = iget(UNIONFS_SB(sb)->odf.path.mnt->mnt_sb, ino);
+ if (odf_inode == NULL) {
+ return ERR_PTR(-ENOMEM);
+ } else {
+ if (is_bad_inode(odf_inode) || (generation &&
+ odf_inode->i_generation != generation)) {
+ iput(odf_inode);
+ return ERR_PTR(-ESTALE);
+ }
+ }
+ iput(odf_inode);
+
inode = iget(sb, ino);
if (inode == NULL)
return ERR_PTR(-ENOMEM);
- /* A generation of 0 means "accept any" */
- if (is_bad_inode(inode) || (generation
- && inode->i_generation != generation)) {
- /* we didn't find the right inode.. */
- printk(KERN_ERR "fh_verify: Inode %lu, Bad count: %d %d "
- "or version %u %u\n", inode->i_ino, inode->i_nlink,
- atomic_read(&inode->i_count), inode->i_generation,
- generation);
-
- iput(inode);
- return ERR_PTR(-ESTALE);
- }
-
/* Now find a dentry. If possible, get a well-connected one */
result = d_alloc_anon(inode);
if (!result) {