On Mon, Sep 02, 2019 at 10:09:16AM -0700, Darrick J. Wong wrote:
> On Mon, Sep 02, 2019 at 06:29:34PM +0200, Christoph Hellwig wrote:
> > On Sun, Sep 01, 2019 at 03:08:22PM -0500, Goldwyn Rodrigues wrote:
> > > From: Goldwyn Rodrigues <rgold...@suse.com>
> > > 
> > > To improve debugging abilities, especially invalid option
> > > asserts.
> > 
> > Looking at the code I'd much rather have unconditional WARN_ON_ONCE
> > statements in most places.  Including returning an error when we see
> > something invalid in most cases.
> 
> Yeah, I was thinking something like this, which has the advantage that
> the report format is familiar to XFS developers and will get picked up
> by the automated error collection stuff I put in xfstests to complain
> about any XFS assertion failures:
> 
> iomap: Introduce CONFIG_FS_IOMAP_DEBUG
> 
> To improve debugging abilities, especially invalid option
> asserts.

I'd actually just rather have more unconditional WARN_ON_ONCE calls,
including actually recovering from the situation by return an actual
error code.  That is more

        if (WARN_ON_ONCE(some_impossible_condition))
                return -EIO;

Reply via email to