xfs
[Top] [All Lists]

Re: [PATCH] xfs: create helper for bmap finish & trans join in xfs_attr.

To: xfs@xxxxxxxxxxx
Subject: Re: [PATCH] xfs: create helper for bmap finish & trans join in xfs_attr.c
From: Eric Sandeen <sandeen@xxxxxxxxxxx>
Date: Wed, 11 Nov 2015 22:58:45 -0600
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <56441B8E.6070603@xxxxxxxxxx>
References: <56441B8E.6070603@xxxxxxxxxx>
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.3.0

On 11/11/15 10:54 PM, Eric Sandeen wrote:
> Calls to xfs_bmap_finish() and xfs_trans_ijoin(), and the
> associated comments were replicated several times across
> xfs_attr.c.
> 
> Factor out a new helper function, xfs_bmap_finish_and_join()
> to take care of this.
> 
> This also fixes an ASSERT() test of an uninitialized variable
> in several locations:
> 
>       error = xfs_attr_thing(&args);
>       if (!error) {
>               error = xfs_bmap_finish(&args.trans, args.flist,
>                                       &committed);
>       }
>       if (error) {
>               ASSERT(committed);
> 
> If the first xfs_attr_thing() failed, we'd skip the xfs_bmap_finish,
> never set "committed", and then test it in the ASSERT.

Whoops, of course right after I send it I see that this can be used
(and the ASSERT problem exists) in xfs_attr_remote.c as well;
I'll send V2 tomorrow.

-Eric

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