]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
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>
Thu, 9 Aug 2012 15:02:12 +0000 (08:02 -0700)
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.

Reviewed-on: http://gerrit.openafs.org/6411
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit 456ee898ae77b201275363f4efc0098c28e195d5)

Change-Id: Idd2e6b85d27a914cac0169a6e8fdee49ff262dc0
Reviewed-on: http://gerrit.openafs.org/7937
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 37df3302bb96debb1e7cd4d3891e34c3dcab54fb..0efcbaba1f7a5f7fac9d6c916ec1368774b744fc 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 4012ff7332b788cc60e0b854c99cbbb46d06c0b9..bbecfd4f49fd5877c609b69f76380b8fc6213507 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 02fe2536fa8a56d1ac98d9427386c3dd23459d18..484c633039731d12ed1b9a3d6414f62040df328a 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 1bba21f8d291052404cd8adb14d986ec788cf7ff..2afe1da6e08c024b1c4ab704f856ea5d177facd8 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 1800d759e2a1903e386192ced4ec25d9beecb6c9..f351910c846e5e71cfe299b81363bc28bb788791 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 3c20fd9f80c3157a953b34e54e3e50960ad2e9a0..59e7d578503ec7831687dbf7029061df3aa14fe5 100644 (file)
@@ -216,7 +216,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)
@@ -251,7 +251,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 875138808eae8113d28f7db1273baae697280610..b01be67dddca23d6df94a75b38c245a986b9fd5a 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 8c93145f344ab7fee08756ce6e8d8993d67cd47f..e27a19c62b27706e7f9b2aa8f11ee21c40349dfb 100644 (file)
@@ -142,7 +142,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 a82cd02b81201ccb73450aff0c0a299102f62726..e9921988ce52b8e764e7ab34e5493f2fc53f7a8c 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 a9e97ed66d664bc206685029f6db8a181076592d..de7b2090871bb95903fa4f85071e65b05aaa6c24 100644 (file)
@@ -379,7 +379,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)