# Re: \[PATCH 7/6\] fs: improve comment in fserror\_alloc\_event

- From: Jan Kara \<jack@suse.cz\>
- Date: 2026-01-07 09:20:02 
- List: linux-api
- Page: https://ratatoskr.run/linux-api/2026/01/335539
- Thread: https://ratatoskr.run/linux-api/2025/12/334530/t.md

```text
On Tue 06-01-26 15:33:49, Darrick J. Wong wrote:
> From: Darrick J. Wong <djwong@kernel.org>
> 
> Document the ordering requirements between SB_ACTIVE and
> s_pending_errors in the new fserror code.
> 
> Cc: jack@suse.cz
> Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>

Thanks! I guess this will be folded into the original patch but just in
case:

Reviewed-by: Jan Kara <jack@suse.cz>

								Honza

> ---
>  fs/fserror.c |    5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/fs/fserror.c b/fs/fserror.c
> index ec92f5a6db59ce..06ca86adab9b76 100644
> --- a/fs/fserror.c
> +++ b/fs/fserror.c
> @@ -79,6 +79,11 @@ static inline struct fserror_event *fserror_alloc_event(struct super_block *sb,
>  	 * If pending_errors already reached zero or is no longer active,
>  	 * the superblock is being deactivated so there's no point in
>  	 * continuing.
> +	 *
> +	 * The order of the check of s_pending_errors and SB_ACTIVE are
> +	 * mandated by order of accesses in generic_shutdown_super and
> +	 * fserror_unmount.  Barriers are implicitly provided by the refcount
> +	 * manipulations in this function and fserror_unmount.
>  	 */
>  	if (!refcount_inc_not_zero(&sb->s_pending_errors))
>  		return NULL;
-- 
Jan Kara [ref]
SUSE Labs, CR
```
