afs: afs_osi_Read/Write returns negative on error
authorAndrew Deason <adeason@sinenomine.net>
Thu, 22 Dec 2011 19:50:09 +0000 (14:50 -0500)
committerDerrick Brashear <shadow@dementix.org>
Tue, 27 Dec 2011 04:27:38 +0000 (20:27 -0800)
afs_osi_Read and afs_osi_Write need to return negative values on
error. EIO is not negative; return -EIO so we don't accidentally
return "success" if someone requested to read or write EIO bytes.

Change-Id: Id0693776737fdf7086de16a935ad3942f5026e55
Reviewed-on: http://gerrit.openafs.org/6411
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

src/afs/AIX/osi_file.c
src/afs/DARWIN/osi_file.c
src/afs/FBSD/osi_file.c
src/afs/HPUX/osi_file.c
src/afs/IRIX/osi_file.c
src/afs/LINUX/osi_file.c
src/afs/LINUX24/osi_file.c
src/afs/NBSD/osi_file.c
src/afs/OBSD/osi_file.c
src/afs/SOLARIS/osi_file.c

index 37df330..0efcbab 100644 (file)
@@ -164,7 +164,7 @@ afs_osi_Read(struct osi_file *afile, int offset, void *aptr,
        if (!afs_shuttingdown)
            osi_Panic("osi_Read called with null param");
        else
-           return EIO;
+           return -EIO;
     }
 
     if (offset != -1)
index 4012ff7..bbecfd4 100644 (file)
@@ -321,7 +321,7 @@ afs_osi_Read(struct osi_file *afile, int offset, void *aptr,
        if (!afs_shuttingdown)
            osi_Panic("osi_Read called with null param");
        else
-           return EIO;
+           return -EIO;
     }
 
     if (offset != -1)
index 02fe253..484c633 100644 (file)
@@ -170,7 +170,7 @@ afs_osi_Read(struct osi_file *afile, int offset, void *aptr,
        if (!afs_shuttingdown)
            osi_Panic("osi_Read called with null param");
        else
-           return EIO;
+           return -EIO;
     }
 
     if (offset != -1)
index 1bba21f..2afe1da 100644 (file)
@@ -150,7 +150,7 @@ afs_osi_Read(struct osi_file *afile, int offset, void *aptr,
        if (!afs_shuttingdown)
            osi_Panic("osi_Read called with null param");
        else
-           return EIO;
+           return -EIO;
     }
 
     if (offset != -1)
index 1800d75..f351910 100644 (file)
@@ -144,7 +144,7 @@ afs_osi_Read(struct osi_file *afile, int offset, void *aptr,
        if (!afs_shuttingdown)
            osi_Panic("osi_Read called with null param");
        else
-           return EIO;
+           return -EIO;
     }
 
     if (offset != -1)
index 843ce7a..72f020c 100644 (file)
@@ -215,7 +215,7 @@ afs_osi_Read(struct osi_file *afile, int offset, void *aptr,
        if (!afs_shuttingdown)
            osi_Panic("osi_Read called with null param");
        else
-           return EIO;
+           return -EIO;
     }
 
     if (offset != -1)
@@ -250,7 +250,7 @@ afs_osi_Write(struct osi_file *afile, afs_int32 offset, void *aptr,
        if (!afs_shuttingdown)
            osi_Panic("afs_osi_Write called with null param");
        else
-           return EIO;
+           return -EIO;
     }
 
     if (offset != -1)
index 8751388..b01be67 100644 (file)
@@ -200,7 +200,7 @@ afs_osi_Read(struct osi_file *afile, int offset, void *aptr,
        if (!afs_shuttingdown)
            osi_Panic("osi_Read called with null param");
        else
-           return EIO;
+           return -EIO;
     }
 
     if (offset != -1)
@@ -235,7 +235,7 @@ afs_osi_Write(struct osi_file *afile, afs_int32 offset, void *aptr,
        if (!afs_shuttingdown)
            osi_Panic("afs_osi_Write called with null param");
        else
-           return EIO;
+           return -EIO;
     }
 
     if (offset != -1)
index d162f6e..e5ef681 100644 (file)
@@ -157,7 +157,7 @@ afs_osi_Read(struct osi_file *afile, int offset, void *aptr, afs_int32 asize)
        if (!afs_shuttingdown)
            osi_Panic("osi_Read called with null param");
        else
-           return EIO;
+           return -EIO;
     }
 
     if (offset != -1)
index a82cd02..e992198 100644 (file)
@@ -146,7 +146,7 @@ afs_osi_Read(struct osi_file *afile, int offset, void *aptr, afs_int32 asize)
        if (!afs_shuttingdown)
            osi_Panic("osi_Read called with null param");
        else
-           return EIO;
+           return -EIO;
     }
 
     if (offset != -1)
index 8f92cc8..f066618 100644 (file)
@@ -364,7 +364,7 @@ afs_osi_Read(struct osi_file *afile, int offset, void *aptr,
        if (!afs_shuttingdown)
            osi_Panic("osi_Read called with null param");
        else
-           return EIO;
+           return -EIO;
     }
 
     if (offset != -1)