LICENSE IPL10
FIXES 124580
avoid returning a positive error as it will look like a pointer.
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,2,10)
if (code == ENOENT)
return ERR_PTR(0);
- else
+ else if ((code >= 0) && (code <= MAX_ERRNO))
return ERR_PTR(-code);
+ else
+ return ERR_PTR(-EIO);
#else
if (code == ENOENT)
code = 0;
if (code < 0) {
dput(basep);
- res = ERR_PTR(code);
+ if (code < -MAX_ERRNO)
+ res = ERR_PTR(-EIO);
+ else
+ res = ERR_PTR(code);
} else {
name[code] = '\0';
res = lookup_dentry(name, basep, follow);
afs_PutVolume(volp, READ_LOCK);
/* If we did the InlineBulk RPC pull out the return code */
- if (inlinebulk) {
+ if (inlinebulk && code == 0) {
if ((&statsp[0])->errorCode) {
afs_Analyze(tcp, (&statsp[0])->errorCode, &adp->fid, areqp,
AFS_STATS_FS_RPCIDX_BULKSTATUS, SHARED_LOCK, NULL);