diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2012-01-10 10:46:03 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-01-10 11:13:13 -0500 |
commit | 0b2c4e39c014219ef73f05ab580c284bf8e6af0a (patch) | |
tree | 4447c0dbab25dc209f267c17123845b1d3bb8273 /fs/coda/dir.c | |
parent | 3e25eb9c4bb649acdddb333d10774b640190f727 (diff) |
coda: deal correctly with allocation failure from coda_cnode_makectl()
lookup should fail with ENOMEM, not silently make dentry negative.
Switched to saner calling conventions, while we are at it.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/coda/dir.c')
-rw-r--r-- | fs/coda/dir.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/coda/dir.c b/fs/coda/dir.c index 83d2fd8ec24b..df0f9c1b01d3 100644 --- a/fs/coda/dir.c +++ b/fs/coda/dir.c | |||
@@ -111,7 +111,7 @@ static struct dentry *coda_lookup(struct inode *dir, struct dentry *entry, struc | |||
111 | 111 | ||
112 | /* control object, create inode on the fly */ | 112 | /* control object, create inode on the fly */ |
113 | if (coda_isroot(dir) && coda_iscontrol(name, length)) { | 113 | if (coda_isroot(dir) && coda_iscontrol(name, length)) { |
114 | error = coda_cnode_makectl(&inode, dir->i_sb); | 114 | inode = coda_cnode_makectl(dir->i_sb); |
115 | type = CODA_NOCACHE; | 115 | type = CODA_NOCACHE; |
116 | goto exit; | 116 | goto exit; |
117 | } | 117 | } |
@@ -125,7 +125,7 @@ static struct dentry *coda_lookup(struct inode *dir, struct dentry *entry, struc | |||
125 | return ERR_PTR(error); | 125 | return ERR_PTR(error); |
126 | 126 | ||
127 | exit: | 127 | exit: |
128 | if (inode && (type & CODA_NOCACHE)) | 128 | if (inode && !IS_ERR(inode) && (type & CODA_NOCACHE)) |
129 | coda_flag_inode(inode, C_VATTR | C_PURGE); | 129 | coda_flag_inode(inode, C_VATTR | C_PURGE); |
130 | 130 | ||
131 | return d_splice_alias(inode, entry); | 131 | return d_splice_alias(inode, entry); |