Re: ReiserFS / 2.4.6 / Data Corruption

Chris Mason (mason@suse.com)
Tue, 31 Jul 2001 11:58:09 -0400


On Wednesday, August 01, 2001 03:15:54 AM +1200 Chris Wedgwood <cw@f00f.org>
wrote:

> On Tue, Jul 31, 2001 at 09:41:25AM -0400, Chris Mason wrote:
>
> if (some_error) {
> #ifdef CONFIG_REISERFS_CHECK
> panic("some_error") ;
> #else
> gracefully_recover
> #endif
>
> What a terrible construct... if would be much more elegant as:
>
> if(some_error) {
> _namesys_internal_foo("some_error");
> recover_bar();
> }
>
> where _namesys_internal_foo is compiled differently and may not return
> depending on CONFIG_REISERFS_CHECK and maybe also the error type.

Two part answer...

1) almost none of the CONFIG_REISERFS_CHECKs look like that, it was an
oversimplified example ;-)

2) Even still, the #ifdefs look nasty, and make the code hard to read. Take
a look at the latest ac release, which has a patch from Nikita that is
similar to what you describe.

-chris

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