[PATCH] ext2_new_block cleanups and fixes
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; }
Showing
Please register or sign in to comment