Re: [RFC PATCH 0/4] fs: introduce new writeback error tracking infrastructure and convert ext4 to use it

From: NeilBrown
Date: Thu Apr 06 2017 - 18:16:23 EST


On Thu, Apr 06 2017, Jeff Layton wrote:

>
> I tried to avoid updating things unnecesssarily. I could use some
> guidance on how to specify the constants in terms of MAX_ERRNO as well.

ilog2() defined in include/linux/log2.h

And you have MAX_ERROR in one comment, instead of MAX_ERRNO :-)

>
> - flush: called by the close(2) system call to flush a file
> + flush: called by the close(2) system call to flush a file. Writeback
> + errors not previously reported via fsync should be reported
> + here as you would for fsync.

"could", not "should". I think it is agreed that this is a good
idea, is it?

> diff --git a/include/linux/fs.h b/include/linux/fs.h
> index 7251f7bb45e8..f33857113ff4 100644
> --- a/include/linux/fs.h
> +++ b/include/linux/fs.h
> @@ -394,6 +394,7 @@ struct address_space {
> gfp_t gfp_mask; /* implicit gfp mask for allocations */
> struct list_head private_list; /* ditto */
> void *private_data; /* ditto */
> + u32 wb_err;

I would rather this was a wb_err_t or similar, and that the functions
which implement it take a pointer to a wb_err_t.
Then the 'error' in 'struct nfs_open_context' could become a 'wb_err_t',
and nfs could use these functions to do error tracking the way it wants
to.

Thanks - looking good.

NeilBrown

Attachment: signature.asc
Description: PGP signature