Re: [PATCH 1/3] xfs: make attr lookup returns consistent

Dave Chinner
2019-08-29T10:32:37Z

On Thu, Aug 29, 2019 at 12:41:39AM -0700, Christoph Hellwig wrote:
> On Wed, Aug 28, 2019 at 02:23:48PM +1000, Dave Chinner wrote:
> > @@ -1289,29 +1301,32 @@ xfs_attr_node_get(xfs_da_args_t *args)
> > state->mp = args->dp->i_mount;
> >
> > /*
> > - * Search to see if name exists, and get back a pointer to it.
> > + Search to see if name exists, and get back a pointer to it.
> > */
> > error = xfs_da3_node_lookup_int(state, &retval);
> > if (error) {
> > retval = error;
>
> Given that you are cleaning up this mess, can you check if there
> is any point in the weird xfs_da3_node_lookup_int calling conventions?

retval propagates down into child functions like
xfs_da3_path_shift(), xfs_dir2_leafn_lookup_int(), etc, so
untangling that mess is non-trivial.

> It looks like it can return errnos in both the return value and
> *revtval, and from a quick check it seems like all callers treat them
> more or less the same.

Maybe so, but I don't have the time to do a deep dive into both the
directory and the attribute code to determine what such a cleanup
might look like. I think it's way out of scope for the problem being
solved by this patchset...

Cheers,

Dave.
--
Dave Chinner
david@fromorbit.com