Re: [PATCH v5 04/14] xfs: Add xfs_has_attr and subroutines

Christoph Hellwig
2019-12-24T12:18:31Z

On Wed, Dec 11, 2019 at 09:15:03PM -0700, Allison Collins wrote:
> From: Allison Henderson <allison.henderson@oracle.com>
>
> This patch adds a new functions to check for the existence of
> an attribute. Subroutines are also added to handle the cases
> of leaf blocks, nodes or shortform. Common code that appears
> in existing attr add and remove functions have been factored
> out to help reduce the appearance of duplicated code. We will
> need these routines later for delayed attributes since delayed
> operations cannot return error codes.

Can you explain why we need the ahead of time check? The first
operation should be able to still return an error, and doing
a separate check instead of letting the actual operation fail
gracefully is more expensive, and also creates a lot of additional
code. As is I can't say I like the direction at all.