Currently afs_osi_Read and afs_osi_Write just return -1 on any I/O
error, even though they know the error code given from the OS VFS.
Just return that code instead so the caller can see what the error
was; but negate it, so it's clear that it is an error.
Reviewed-on: http://gerrit.openafs.org/6412
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit
b5ca12ac4696c4049be14974f1e946bb55e1c440)
Change-Id: Ib5a674af7e0424691887b20d24782a6740d11414
Reviewed-on: http://gerrit.openafs.org/7938
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
goto retry_IO;
}
setuerror(code);
- code = -1;
+ if (code > 0) {
+ code *= -1;
+ }
}
return code;
}
afs_warnuser
("\n\n\n*** Cache partition is FULL - Decrease cachesize!!! ***\n\n");
setuerror(code);
- code = -1;
+ if (code > 0) {
+ code *= -1;
+ }
}
if (afile->proc) {
(*afile->proc) (afile, code);
} else {
afs_Trace2(afs_iclSetp, CM_TRACE_READFAILED, ICL_TYPE_INT32, resid,
ICL_TYPE_INT32, code);
- code = -1;
+ if (code > 0) {
+ code *= -1;
+ }
}
return code;
}
code = asize - resid;
afile->offset += code;
} else {
- code = -1;
+ if (code > 0) {
+ code *= -1;
+ }
}
if (afile->proc) {
(*afile->proc) (afile, code);
} else {
afs_Trace2(afs_iclSetp, CM_TRACE_READFAILED, ICL_TYPE_INT32, resid,
ICL_TYPE_INT32, code);
- code = -1;
+ if (code > 0) {
+ code *= -1;
+ }
}
return code;
}
code = asize - resid;
afile->offset += code;
} else {
- code = -1;
+ if (code > 0) {
+ code *= -1;
+ }
}
if (afile->proc) {
(*afile->proc) (afile, code);
goto retry_IO;
}
setuerror(code);
- code = -1;
+ if (code > 0) {
+ code *= -1;
+ }
}
return code;
}
afs_warnuser
("\n\n\n*** Cache partition is FULL - Decrease cachesize!!! ***\n\n");
setuerror(code);
- code = -1;
+ if (code > 0) {
+ code *= -1;
+ }
}
if (afile->proc) {
(*afile->proc) (afile, code);
} else {
afs_Trace2(afs_iclSetp, CM_TRACE_READFAILED, ICL_TYPE_INT32, resid,
ICL_TYPE_INT32, code);
- code = -1;
+ if (code > 0) {
+ code *= -1;
+ }
}
return code;
}
if (code == ENOSPC)
afs_warnuser
("\n\n\n*** Cache partition is FULL - Decrease cachesize!!! ***\n\n");
- code = -1;
+ if (code > 0) {
+ code *= -1;
+ }
}
if (afile->proc) {
(*afile->proc) (afile, code);
} else {
afs_Trace2(afs_iclSetp, CM_TRACE_READFAILED, ICL_TYPE_INT32, auio.uio_resid,
ICL_TYPE_INT32, code);
- code = -1;
+ if (code > 0) {
+ code *= -1;
+ }
}
return code;
}
if (code == ENOSPC)
afs_warnuser
("\n\n\n*** Cache partition is FULL - Decrease cachesize!!! ***\n\n");
- code = -1;
+ if (code > 0) {
+ code *= -1;
+ }
}
if (afile->proc)
} else {
afs_Trace2(afs_iclSetp, CM_TRACE_READFAILED, ICL_TYPE_INT32, auio.uio_resid,
ICL_TYPE_INT32, code);
- code = -1;
+ if (code > 0) {
+ code *= -1;
+ }
}
return code;
}
if (code == ENOSPC)
afs_warnuser
("\n\n\n*** Cache partition is FULL - Decrease cachesize!!! ***\n\n");
- code = -1;
+ if (code > 0) {
+ code *= -1;
+ }
}
if (afile->proc)
} else {
afs_Trace2(afs_iclSetp, CM_TRACE_READFAILED, ICL_TYPE_INT32, resid,
ICL_TYPE_INT32, code);
- code = -1;
+ if (code > 0) {
+ code *= -1;
+ }
}
return code;
}
afile->offset += code;
if (afile->offset > afile->size)
afile->size = afile->offset;
- } else
- code = -1;
+ } else {
+ if (code > 0) {
+ code *= -1;
+ }
+ }
if (afile->proc)
(*afile->proc) (afile, code);
} else {
afs_Trace2(afs_iclSetp, CM_TRACE_READFAILED, ICL_TYPE_INT32,
(unsigned int) resid, ICL_TYPE_INT32, code);
- code = -1;
+ if (code > 0) {
+ code *= -1;
+ }
}
return code;
}
afile->offset += code;
if (afile->offset > afile->size)
afile->size = afile->offset;
- } else
- code = -1;
+ } else {
+ if (code > 0) {
+ code *= -1;
+ }
+ }
if (afile->proc)
(*afile->proc) (afile, code);
} else {
afs_Trace2(afs_iclSetp, CM_TRACE_READFAILED, ICL_TYPE_INT32, resid,
ICL_TYPE_INT32, code);
- code = -1;
+ if (code > 0) {
+ code *= -1;
+ }
}
return code;
}
code = asize - resid;
afile->offset += code;
} else {
- code = -1;
+ if (code > 0) {
+ code *= -1;
+ }
}
if (afile->proc) {
(*afile->proc) (afile, code);