[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAJfpegt4+W2N0UW=6JtCAhVdkJisy5Q0+=T19fkQBDcRxjAn4g@mail.gmail.com>
Date: Mon, 4 Dec 2023 10:18:11 +0100
From: Miklos Szeredi <miklos@...redi.hu>
To: Vivek Goyal <vgoyal@...hat.com>
Cc: Hangyu Hua <hbh25y@...il.com>, linux-fsdevel@...r.kernel.org,
linux-kernel@...r.kernel.org, jefflexu@...ux.alibaba.com
Subject: Re: [PATCH] fs: fuse: dax: set fc->dax to NULL in fuse_dax_conn_free()
On Fri, 1 Dec 2023 at 20:08, Vivek Goyal <vgoyal@...hat.com> wrote:
>
> On Fri, Dec 01, 2023 at 10:42:53AM +0800, Hangyu Hua wrote:
> > I think setting fc->dax to NULL keeps the memory allocation and release
> > functions together in fuse_fill_super_common more readable. What do you
> > think?
>
> I agree with this. fuse_fill_super_common() calls fuse_dax_conn_alloc()
> which in-turn initializes fc->dax. If fuse_fill_super_common() fails
> later after calling fuse_dax_conn_alloc(), then cleanup of fc->dax
> and other associated stuff in same function makes sense.
>
> As a code reader I would like to know how fc->dax is being freed in
> case of error and its right there in the error path (err_free_dax:).
>
> I think I set the fc->dax upon initialization. Upon failure I freed
> the data structures but did not set fc->dax back to NULL.
>
> To me, this patch looks reasonable.
>
> Acked-by: Vivek Goyal <vgoyal@...hat.com>
Applied, thanks.
The patch is clearly correct, so I have not major issue with it. It
just bothers me a little that we have two cleanup instances when we
only need one, but I bow to the opinion of the majority.
Thanks,
Miklos
Powered by blists - more mailing lists