Commit 970648eb authored by Jan Harkes's avatar Jan Harkes Committed by Linus Torvalds

coda: ignore returned values when upcalls return errors

Venus returns an ENOENT error on open, so we shouldn't try to grab the
filehandle for the returned fd.
Signed-off-by: default avatarJan Harkes <jaharkes@cs.cmu.edu>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 37461e19
...@@ -84,12 +84,8 @@ int venus_rootfid(struct super_block *sb, struct CodaFid *fidp) ...@@ -84,12 +84,8 @@ int venus_rootfid(struct super_block *sb, struct CodaFid *fidp)
UPARG(CODA_ROOT); UPARG(CODA_ROOT);
error = coda_upcall(coda_sbp(sb), insize, &outsize, inp); error = coda_upcall(coda_sbp(sb), insize, &outsize, inp);
if (!error)
if (error) {
printk("coda_get_rootfid: error %d\n", error);
} else {
*fidp = outp->coda_root.VFid; *fidp = outp->coda_root.VFid;
}
CODA_FREE(inp, insize); CODA_FREE(inp, insize);
return error; return error;
...@@ -107,7 +103,7 @@ int venus_getattr(struct super_block *sb, struct CodaFid *fid, ...@@ -107,7 +103,7 @@ int venus_getattr(struct super_block *sb, struct CodaFid *fid,
inp->coda_getattr.VFid = *fid; inp->coda_getattr.VFid = *fid;
error = coda_upcall(coda_sbp(sb), insize, &outsize, inp); error = coda_upcall(coda_sbp(sb), insize, &outsize, inp);
if (!error)
*attr = outp->coda_getattr.attr; *attr = outp->coda_getattr.attr;
CODA_FREE(inp, insize); CODA_FREE(inp, insize);
...@@ -154,9 +150,10 @@ int venus_lookup(struct super_block *sb, struct CodaFid *fid, ...@@ -154,9 +150,10 @@ int venus_lookup(struct super_block *sb, struct CodaFid *fid,
*((char *)inp + offset + length) = '\0'; *((char *)inp + offset + length) = '\0';
error = coda_upcall(coda_sbp(sb), insize, &outsize, inp); error = coda_upcall(coda_sbp(sb), insize, &outsize, inp);
if (!error) {
*resfid = outp->coda_lookup.VFid; *resfid = outp->coda_lookup.VFid;
*type = outp->coda_lookup.vtype; *type = outp->coda_lookup.vtype;
}
CODA_FREE(inp, insize); CODA_FREE(inp, insize);
return error; return error;
...@@ -280,9 +277,10 @@ int venus_mkdir(struct super_block *sb, struct CodaFid *dirfid, ...@@ -280,9 +277,10 @@ int venus_mkdir(struct super_block *sb, struct CodaFid *dirfid,
*((char *)inp + offset + length) = '\0'; *((char *)inp + offset + length) = '\0';
error = coda_upcall(coda_sbp(sb), insize, &outsize, inp); error = coda_upcall(coda_sbp(sb), insize, &outsize, inp);
if (!error) {
*attrs = outp->coda_mkdir.attr; *attrs = outp->coda_mkdir.attr;
*newfid = outp->coda_mkdir.VFid; *newfid = outp->coda_mkdir.VFid;
}
CODA_FREE(inp, insize); CODA_FREE(inp, insize);
return error; return error;
...@@ -350,9 +348,10 @@ int venus_create(struct super_block *sb, struct CodaFid *dirfid, ...@@ -350,9 +348,10 @@ int venus_create(struct super_block *sb, struct CodaFid *dirfid,
*((char *)inp + offset + length) = '\0'; *((char *)inp + offset + length) = '\0';
error = coda_upcall(coda_sbp(sb), insize, &outsize, inp); error = coda_upcall(coda_sbp(sb), insize, &outsize, inp);
if (!error) {
*attrs = outp->coda_create.attr; *attrs = outp->coda_create.attr;
*newfid = outp->coda_create.VFid; *newfid = outp->coda_create.VFid;
}
CODA_FREE(inp, insize); CODA_FREE(inp, insize);
return error; return error;
...@@ -419,8 +418,7 @@ int venus_readlink(struct super_block *sb, struct CodaFid *fid, ...@@ -419,8 +418,7 @@ int venus_readlink(struct super_block *sb, struct CodaFid *fid,
inp->coda_readlink.VFid = *fid; inp->coda_readlink.VFid = *fid;
error = coda_upcall(coda_sbp(sb), insize, &outsize, inp); error = coda_upcall(coda_sbp(sb), insize, &outsize, inp);
if (!error) {
if (! error) {
retlen = outp->coda_readlink.count; retlen = outp->coda_readlink.count;
if ( retlen > *length ) if ( retlen > *length )
retlen = *length; retlen = *length;
...@@ -618,15 +616,12 @@ int venus_statfs(struct dentry *dentry, struct kstatfs *sfs) ...@@ -618,15 +616,12 @@ int venus_statfs(struct dentry *dentry, struct kstatfs *sfs)
UPARG(CODA_STATFS); UPARG(CODA_STATFS);
error = coda_upcall(coda_sbp(dentry->d_sb), insize, &outsize, inp); error = coda_upcall(coda_sbp(dentry->d_sb), insize, &outsize, inp);
if (!error) { if (!error) {
sfs->f_blocks = outp->coda_statfs.stat.f_blocks; sfs->f_blocks = outp->coda_statfs.stat.f_blocks;
sfs->f_bfree = outp->coda_statfs.stat.f_bfree; sfs->f_bfree = outp->coda_statfs.stat.f_bfree;
sfs->f_bavail = outp->coda_statfs.stat.f_bavail; sfs->f_bavail = outp->coda_statfs.stat.f_bavail;
sfs->f_files = outp->coda_statfs.stat.f_files; sfs->f_files = outp->coda_statfs.stat.f_files;
sfs->f_ffree = outp->coda_statfs.stat.f_ffree; sfs->f_ffree = outp->coda_statfs.stat.f_ffree;
} else {
printk("coda_statfs: Venus returns: %d\n", error);
} }
CODA_FREE(inp, insize); CODA_FREE(inp, insize);
......
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