xfs
[Top] [All Lists]

Re: [PATCH 3/3] xfs: test for valid remount options, error if not

To: xfs@xxxxxxxxxxx
Subject: Re: [PATCH 3/3] xfs: test for valid remount options, error if not
From: Eric Sandeen <sandeen@xxxxxxxxxxx>
Date: Mon, 15 Feb 2016 17:07:18 -0600
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <20160215202521.GI14668@dastard>
References: <56BBC982.50804@xxxxxxxxxx> <56BBCB9D.6080404@xxxxxxxxxxx> <20160215202521.GI14668@dastard>
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.5.1

On 2/15/16 2:25 PM, Dave Chinner wrote:
> I think hiding a goto like this is wrong - it forces you to go read
> the macro, making the code harder to read and follow. Really, what's
> wrong with the simple and obvious:
> 
> 
>       if (bad option) {
>               bad_option = "bad option string";
>               goto out_warn;
>       }
>       .....
> 
> out_warn:
>       xfs_warn(mp, "%s options may not be changed via remount",
>                bad_option);
>       // free stuff
>       return -EINVAL;
> }
> 
> Yes, I know that this sort of logic flow hiding was done with the
> XFS_WANT_CORRUPTED macros, but they were written back in 90s on Irix
> when using macros to implement everything were all the rage.

Yeah, fair point, not sure why I did that ;)  Old habits?

-Eric

<Prev in Thread] Current Thread [Next in Thread>