Linux EXT4 FS development
 help / color / mirror / Atom feed
* [PATCH] jbd2: Document the h_invalid flag of a handle
@ 2026-11-25 18:40 TAKANO Mitsuhiro
  2026-11-25 18:45 ` sashiko-bot
  2026-11-25 20:06 ` Jan Kara
  0 siblings, 2 replies; 4+ messages in thread
From: TAKANO Mitsuhiro @ 2026-11-25 18:40 UTC (permalink / raw)
  To: Theodore Ts'o, Jan Kara; +Cc: linux-ext4, linux-kernel, TAKANO Mitsuhiro

struct jbd2_journal_handle has an h_invalid bit: ext4 sets it when it
has given up on the handle, and __ext4_journal_stop() BUG_ONs when the
bit is clear.  The kernel-doc comment lists the other three flags and
not this one, so kernel-doc reports the member twice:

  Warning: include/linux/jbd2.h:523 struct member 'h_invalid' not
  described in 'jbd2_journal_handle'

Add the line next to h_aborted.

Verification: kernel-doc -none include/linux/jbd2.h prints that warning
twice before the change and nothing after it.

Signed-off-by: TAKANO Mitsuhiro <takano32@gmail.com>
---
 include/linux/jbd2.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h
index e3886963ba00..361aa5dbe395 100644
--- a/include/linux/jbd2.h
+++ b/include/linux/jbd2.h
@@ -482,6 +482,7 @@ struct jbd2_revoke_table_s;
  * @h_sync: Flag for sync-on-close.
  * @h_reserved: Flag for handle for reserved credits.
  * @h_aborted: Flag indicating fatal error on handle.
+ * @h_invalid: Flag indicating the handle must not be used any more.
  * @h_type: For handle statistics.
  * @h_line_no: For handle statistics.
  * @h_start_jiffies: Handle Start time.

base-commit: b6a9fa34ce4187cb69d3c588a4bbffc31ce5db8f
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] jbd2: Document the h_invalid flag of a handle
  2026-11-25 18:40 [PATCH] jbd2: Document the h_invalid flag of a handle TAKANO Mitsuhiro
@ 2026-11-25 18:45 ` sashiko-bot
  2026-11-25 20:06 ` Jan Kara
  1 sibling, 0 replies; 4+ messages in thread
From: sashiko-bot @ 2026-11-25 18:45 UTC (permalink / raw)
  To: TAKANO Mitsuhiro; +Cc: linux-ext4, tytso

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] jbd2: inaccurate kernel-doc and changelog description of
  h_invalid
--

commit d4f35738c639ebc73d068c9aba7408601b8ba4ea
Author: TAKANO Mitsuhiro <takano32@gmail.com>

jbd2: Document the h_invalid flag of a handle

This commit adds a kernel-doc entry for the h_invalid member of struct
jbd2_journal_handle to silence kernel-doc warnings.

> diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h
> index e3886963ba004..361aa5dbe3954 100644
> --- a/include/linux/jbd2.h
> +++ b/include/linux/jbd2.h
> @@ -482,6 +482,7 @@ struct jbd2_revoke_table_s;
>   * @h_sync: Flag for sync-on-close.
>   * @h_reserved: Flag for handle for reserved credits.
>   * @h_aborted: Flag indicating fatal error on handle.
> + * @h_invalid: Flag indicating the handle must not be used any more.

[Severity: Low]
Are this kernel-doc description and the commit message accurate about
what h_invalid means?

ext4_get_nojournal() sets h_invalid = 1 when allocating a dummy handle in
no-journal mode so current->journal_info can hold saved_alloc_context and
track nested starts via h_ref without a JBD2 journal, and
ext4_handle_valid() checks !handle->h_invalid to test whether an active
handle uses a journal.

Also, __ext4_journal_stop() does not BUG_ON when h_invalid is clear; it
calls ext4_put_nojournal() when h_invalid is set and jbd2_journal_stop()
when h_invalid is clear (the BUG_ON(handle && !handle->h_invalid) check
is in ext4_get_nojournal()).

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261125184027.2402549-1-takano32@gmail.com?part=1

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] jbd2: Document the h_invalid flag of a handle
  2026-11-25 18:40 [PATCH] jbd2: Document the h_invalid flag of a handle TAKANO Mitsuhiro
  2026-11-25 18:45 ` sashiko-bot
@ 2026-11-25 20:06 ` Jan Kara
  2026-11-25 22:18   ` TAKANO Mitsuhiro
  1 sibling, 1 reply; 4+ messages in thread
From: Jan Kara @ 2026-11-25 20:06 UTC (permalink / raw)
  To: TAKANO Mitsuhiro; +Cc: Theodore Ts'o, Jan Kara, linux-ext4, linux-kernel

On Wed 25-11-26 18:40:27, TAKANO Mitsuhiro wrote:
> struct jbd2_journal_handle has an h_invalid bit: ext4 sets it when it
> has given up on the handle, and __ext4_journal_stop() BUG_ONs when the
> bit is clear.  The kernel-doc comment lists the other three flags and
> not this one, so kernel-doc reports the member twice:
> 
>   Warning: include/linux/jbd2.h:523 struct member 'h_invalid' not
>   described in 'jbd2_journal_handle'
> 
> Add the line next to h_aborted.
> 
> Verification: kernel-doc -none include/linux/jbd2.h prints that warning
> twice before the change and nothing after it.
> 
> Signed-off-by: TAKANO Mitsuhiro <takano32@gmail.com>

See below for updated text:

> @@ -482,6 +482,7 @@ struct jbd2_revoke_table_s;
>   * @h_sync: Flag for sync-on-close.
>   * @h_reserved: Flag for handle for reserved credits.
>   * @h_aborted: Flag indicating fatal error on handle.
> + * @h_invalid: Flag indicating the handle must not be used any more.

Please write here "Flag indicating the handle is not pointing to a real
journal. Used by ext4 nojournal mode."

>   * @h_type: For handle statistics.
>   * @h_line_no: For handle statistics.
>   * @h_start_jiffies: Handle Start time.

								Honza
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] jbd2: Document the h_invalid flag of a handle
  2026-11-25 20:06 ` Jan Kara
@ 2026-11-25 22:18   ` TAKANO Mitsuhiro
  0 siblings, 0 replies; 4+ messages in thread
From: TAKANO Mitsuhiro @ 2026-11-25 22:18 UTC (permalink / raw)
  To: Jan Kara; +Cc: Theodore Ts'o, linux-ext4, linux-kernel

Hi Honza,

thanks for the wording.  I am withdrawing this one rather than sending a
v2: the same warning is already fixed in the ext4 tree by Amit Patole's
patch, applied as commit 008aad6508e3.  My duplicate check looked for my
own posts and for the subject I had written, so it missed his.

If you would rather have the comment read the way you wrote it than the
way it stands in 008aad6508e3, say so and I will send a one-line
follow-up on top of that commit.  Otherwise please drop mine.

Thanks,
TAKANO


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-11-25 22:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-25 18:40 [PATCH] jbd2: Document the h_invalid flag of a handle TAKANO Mitsuhiro
2026-11-25 18:45 ` sashiko-bot
2026-11-25 20:06 ` Jan Kara
2026-11-25 22:18   ` TAKANO Mitsuhiro

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox