• Andrew Morton's avatar
    [PATCH] ext2_new_block cleanups and fixes · 2ef0192c
    Andrew Morton authored
    The general error logic handling in there is:
    
    	*errp = -EFOO;
    	<lots of code>
    	if (some_error)
    		goto out;
    
    this is fragile and unmaintainable, because the setting of the error code is
    "far away" from the site where the error was detected.
    
    And the code was actually wrong - we're returning ENOSPC in places where fs
    metadata inconsistency was detected.  We traditionally return -EIO in this
    case.
    
    So change it all to do, effectively:
    
    	if (some_error) {
    		*errp = -EFOO;
    		goto out;
    	}
    2ef0192c
balloc.c 18 KB