Re: [PATCH] 2.4.0test1 - VFS return EIO instead of (eg) ENOSPACE

From: Andreas Dilger (adilger@turbolabs.com)
Date: Tue May 30 2000 - 11:38:38 EST


Ted writes:
> There was one place where an error return that should have beeen ENOSPC
> was changed to return EFBIG. Otherise, I thought your cleanups are fine.

If you are referring to the following fragment (which was omitted from
your patch, so I assume so), then you will note that ext2_alloc_block()
DOES set err in all cases, so we shouldn't really be returning ENOSPC
in this case, but rather whatever ext2_alloc_block() returns.

ext2_alloc_block() calls ext2_new_block() to set err
ext2_new_block() sets *err to ENOSPC always, or EDQUOT, EIO, or 0 as needed;

diff -ru linux-2.3.99p5/fs/ext2/inode.c linux-2.3.99p5-ext2base/fs/ext2/inode.c
--- linux-2.3.99p5/fs/ext2/inode.c Sun Mar 26 21:34:49 2000
+++ linux-2.3.99p5-ext2base/fs/ext2/inode.c Mon May 29 10:36:34 2000
@@ -260,7 +260,6 @@
 
         tmp = ext2_alloc_block (inode, goal, err);
         if (!tmp) {
- *err = -ENOSPC;
                 return NULL;
         }
         if (metadata) {

> @@ -429,6 +428,7 @@
> "block_group = %d,inode=%d", i, j);
> unlock_super (sb);
> iput (inode);
> + *err = EIO; /* Should never happen */
> return NULL;
> }
> gdp->bg_free_inodes_count =

Also note that your return here should be -EIO...

Cheers, Andreas

-- 
Andreas Dilger  \ "If a man ate a pound of pasta and a pound of antipasto,
                 \  would they cancel out, leaving him still hungry?"
http://www-mddsp.enel.ucalgary.ca/People/adilger/               -- Dogbert

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Wed May 31 2000 - 21:00:24 EST