Commit 93c93658 authored by Neil Brown's avatar Neil Brown Committed by Linus Torvalds

[PATCH] PATCH 2/7: knfsd cleanup - FAT shouldn't return NULL

Stop fat_fh_to_dentry returning NULL

the fh_to_dentry routines should never return NULL.
The caller expects an ERR_PTR or a valid (possibly negative)
dentry.  fat did the wrong thing and so could oops.
parent 2712419f
...@@ -430,12 +430,13 @@ struct dentry *fat_fh_to_dentry(struct super_block *sb, __u32 *fh, ...@@ -430,12 +430,13 @@ struct dentry *fat_fh_to_dentry(struct super_block *sb, __u32 *fh,
struct dentry *result; struct dentry *result;
if (fhtype != 3) if (fhtype != 3)
return NULL; return ERR_PTR(-ESTALE);
if (len < 5) if (len < 5)
return NULL; return ERR_PTR(-ESTALE);
if (parent) /* We cannot find the parent,
return NULL; /* We cannot find the parent,
It better just *be* there */ It better just *be* there */
if (parent)
return ERR_PTR(-ESTALE);
inode = iget(sb, fh[0]); inode = iget(sb, fh[0]);
if (!inode || is_bad_inode(inode) || if (!inode || is_bad_inode(inode) ||
......
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