lkml.org 
[lkml]   [2000]   [Mar]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: ext2fs bug : files are disapeared, unable to delete, two files' contents are switched etc.
Date
Ted Ts'o patch has:
> /*
> * N.B. Several error exits in ext2_new_inode don't set err.
> */
> inode = ext2_new_inode (dir, mode, &err);
> if (!inode)
> - return err;
> + return -EIO;

If we are changing namei.c, can we also remove the above (untrue)
comment from ext2_create, and leave the code returning the real err?
Otherwise, we are discarding other (valid) error returns (-EDQUOT,
-ENOSPC, -ENOMEM, -EPERM) for no real reason.

I've looked through ext2_new_inode(), and there are NO returns where
ext2_new_inode() doesn't set err on an error condition. Maybe this
was true at one time, but it is no longer so. The first two returns
set -EPERM and -ENOMEM, and after that err is set to -ENOSPC unless
otherwise specified (for all of the returns where it is not explicitly
set). Arguably, for the returns where there are errors in the bitmaps
or GDT we could return something other than -ENOSPC, but that is
something to fix in ext2_new_inode() and not in the calling function.

The calls to ext2_new_inode() in ext2_mknod(), ext2_mkdir(), and
ext2_symlink() don't have this oddness. In fact, you could get rid of
the initialization of err=-EIO in those functions as well, as err is
always set to SOMETHING in ext2_new_inode...

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/

\
 
 \ /
  Last update: 2005-03-22 13:57    [W:0.040 / U:0.592 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site