Linux EXT4 FS development
 help / color / mirror / Atom feed
* Re: [PATCH] ext4: avoid allocate block from corrupted group in ext4_mb_find_by_goal()
From: Baokun Li @ 2026-03-03  2:36 UTC (permalink / raw)
  To: Ye Bin; +Cc: jack, tytso, adilger.kernel, linux-ext4
In-Reply-To: <20260302134619.3145520-1-yebin@huaweicloud.com>


On 3/2/26 9:46 PM, Ye Bin wrote:
> From: Ye Bin <yebin10@huawei.com>
>
> There's issue as follows:
> ...
> EXT4-fs (mmcblk0p1): Delayed block allocation failed for inode 206 at logical offset 0 with max blocks 1 with error 117
> EXT4-fs (mmcblk0p1): This should not happen!! Data will be lost
>
> EXT4-fs (mmcblk0p1): Delayed block allocation failed for inode 206 at logical offset 0 with max blocks 1 with error 117
> EXT4-fs (mmcblk0p1): This should not happen!! Data will be lost
>
> EXT4-fs (mmcblk0p1): Delayed block allocation failed for inode 206 at logical offset 0 with max blocks 1 with error 117
> EXT4-fs (mmcblk0p1): This should not happen!! Data will be lost
>
> EXT4-fs (mmcblk0p1): Delayed block allocation failed for inode 206 at logical offset 0 with max blocks 1 with error 117
> EXT4-fs (mmcblk0p1): This should not happen!! Data will be lost
>
> EXT4-fs (mmcblk0p1): Delayed block allocation failed for inode 2243 at logical offset 0 with max blocks 1 with error 117
> EXT4-fs (mmcblk0p1): This should not happen!! Data will be lost
>
> EXT4-fs (mmcblk0p1): Delayed block allocation failed for inode 2239 at logical offset 0 with max blocks 1 with error 117
> EXT4-fs (mmcblk0p1): This should not happen!! Data will be lost
>
> EXT4-fs (mmcblk0p1): error count since last fsck: 1
> EXT4-fs (mmcblk0p1): initial error at time 1765597433: ext4_mb_generate_buddy:760
> EXT4-fs (mmcblk0p1): last error at time 1765597433: ext4_mb_generate_buddy:760
> ...
>
> According to the log analysis, blocks are always requested from the
> corrupted block group. This may happen as follows:
> ext4_mb_find_by_goal
>   ext4_mb_load_buddy
>    ext4_mb_load_buddy_gfp
>      ext4_mb_init_cache
>       ext4_read_block_bitmap_nowait
>       ext4_wait_block_bitmap
>        ext4_validate_block_bitmap
>         if (!grp || EXT4_MB_GRP_BBITMAP_CORRUPT(grp))
>          return -EFSCORRUPTED; // There's no logs.
>  if (err)
>   return err;  // Will return error
> ext4_lock_group(ac->ac_sb, group);
>   if (unlikely(EXT4_MB_GRP_BBITMAP_CORRUPT(e4b->bd_info))) // Unreachable
>    goto out;
>
> After commit 9008a58e5dce ("ext4: make the bitmap read routines return
> real error codes") merged, Commit 163a203ddb36 ("ext4: mark block group
> as corrupt on block bitmap error") is no real solution for allocating
> blocks from corrupted block groups. This is because if
> 'EXT4_MB_GRP_BBITMAP_CORRUPT(e4b->bd_info)' is true, then
> 'ext4_mb_load_buddy()' may return an error. This means that the block
> allocation will fail.
> Therefore, check block group if corrupted when ext4_mb_load_buddy()
> returns error.

Good catch!

Agreed, we should try other groups upon failure unless it's a goal-only
allocation.

But note that e4b->bd_info might be uninitialized if ext4_mb_load_buddy()
fails.

I think we can optimize this in ext4_mb_regular_allocator(): we can record
the error from ext4_mb_find_by_goal() but avoid an early exit.

Specifically, after checking that EXT4_MB_HINT_GOAL_ONLY is not set,
we can assign the error to ac->ac_first_err. This way, if subsequent
allocation attempts still fail, we can preserve the original.


Cheers,
Baokun

> Fixes: 163a203ddb36 ("ext4: mark block group as corrupt on block bitmap error")
> Fixes: 9008a58e5dce ("ext4: make the bitmap read routines return real error codes")
> Signed-off-by: Ye Bin <yebin10@huawei.com>
> ---
>  fs/ext4/mballoc.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
> index e2341489f4d0..ffa6886de8a3 100644
> --- a/fs/ext4/mballoc.c
> +++ b/fs/ext4/mballoc.c
> @@ -2443,8 +2443,12 @@ int ext4_mb_find_by_goal(struct ext4_allocation_context *ac,
>  		return 0;
>  
>  	err = ext4_mb_load_buddy(ac->ac_sb, group, e4b);
> -	if (err)
> +	if (err) {
> +		if (EXT4_MB_GRP_BBITMAP_CORRUPT(e4b->bd_info) &&
> +		    !(ac->ac_flags & EXT4_MB_HINT_GOAL_ONLY))
> +			return 0;
>  		return err;
> +	}
>  
>  	ext4_lock_group(ac->ac_sb, group);
>  	if (unlikely(EXT4_MB_GRP_BBITMAP_CORRUPT(e4b->bd_info)))

^ permalink raw reply

* Re: [PATCH v2 105/110] security: replace PRIino with %llu/%llx format strings
From: Paul Moore @ 2026-03-03  2:30 UTC (permalink / raw)
  To: Jeff Layton
  Cc: Alexander Viro, Christian Brauner, Jan Kara, Steven Rostedt,
	Masami Hiramatsu, Mathieu Desnoyers, Dan Williams, Matthew Wilcox,
	Eric Biggers, Theodore Y. Ts'o, Muchun Song, Oscar Salvador,
	David Hildenbrand, David Howells, Paulo Alcantara, Andreas Dilger,
	Jan Kara, Jaegeuk Kim, Chao Yu, Trond Myklebust, Anna Schumaker,
	Chuck Lever, NeilBrown, Olga Kornievskaia, Dai Ngo, Tom Talpey,
	Steve French, Ronnie Sahlberg, Shyam Prasad N, Bharath SM,
	Alexander Aring, Ryusuke Konishi, Viacheslav Dubeyko,
	Eric Van Hensbergen, Latchesar Ionkov, Dominique Martinet,
	Christian Schoenebeck, David Sterba, Marc Dionne, Ian Kent,
	Luis de Bethencourt, Salah Triki, Tigran A. Aivazian,
	Ilya Dryomov, Alex Markuze, Jan Harkes, coda, Nicolas Pitre,
	Tyler Hicks, Amir Goldstein, Christoph Hellwig,
	John Paul Adrian Glaubitz, Yangtao Li, Mikulas Patocka,
	David Woodhouse, Richard Weinberger, Dave Kleikamp,
	Konstantin Komarov, Mark Fasheh, Joel Becker, Joseph Qi,
	Mike Marshall, Martin Brandenburg, Miklos Szeredi, Anders Larsen,
	Zhihao Cheng, Damien Le Moal, Naohiro Aota, Johannes Thumshirn,
	John Johansen, James Morris, Serge E. Hallyn, Mimi Zohar,
	Roberto Sassu, Dmitry Kasatkin, Eric Snowberg, Fan Wu,
	Stephen Smalley, Ondrej Mosnacek, Casey Schaufler, Alex Deucher,
	Christian König, David Airlie, Simona Vetter, Sumit Semwal,
	Eric Dumazet, Kuniyuki Iwashima, Paolo Abeni, Willem de Bruijn,
	David S. Miller, Jakub Kicinski, Simon Horman, Oleg Nesterov,
	Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Namhyung Kim, Mark Rutland, Alexander Shishkin, Jiri Olsa,
	Ian Rogers, Adrian Hunter, James Clark, Darrick J. Wong,
	Martin Schiller, Eric Paris, Joerg Reuter, Marcel Holtmann,
	Johan Hedberg, Luiz Augusto von Dentz, Oliver Hartkopp,
	Marc Kleine-Budde, David Ahern, Neal Cardwell, Steffen Klassert,
	Herbert Xu, Remi Denis-Courmont, Marcelo Ricardo Leitner,
	Xin Long, Magnus Karlsson, Maciej Fijalkowski, Stanislav Fomichev,
	Alexei Starovoitov, Daniel Borkmann, Jesper Dangaard Brouer,
	John Fastabend, linux-fsdevel, linux-kernel, linux-trace-kernel,
	nvdimm, fsverity, linux-mm, netfs, linux-ext4, linux-f2fs-devel,
	linux-nfs, linux-cifs, samba-technical, linux-nilfs, v9fs,
	linux-afs, autofs, ceph-devel, codalist, ecryptfs, linux-mtd,
	jfs-discussion, ntfs3, ocfs2-devel, devel, linux-unionfs,
	apparmor, linux-security-module, linux-integrity, selinux,
	amd-gfx, dri-devel, linux-media, linaro-mm-sig, netdev,
	linux-perf-users, linux-fscrypt, linux-xfs, linux-hams, linux-x25,
	audit, linux-bluetooth, linux-can, linux-sctp, bpf
In-Reply-To: <20260302-iino-u64-v2-105-e5388800dae0@kernel.org>

On Mon, Mar 2, 2026 at 3:50 PM Jeff Layton <jlayton@kernel.org> wrote:
>
> Now that i_ino is u64 and the PRIino format macro has been removed,
> replace all uses in security with the concrete format strings.
>
> Signed-off-by: Jeff Layton <jlayton@kernel.org>
> ---
>  security/apparmor/apparmorfs.c       |  4 ++--
>  security/integrity/integrity_audit.c |  2 +-
>  security/ipe/audit.c                 |  2 +-
>  security/lsm_audit.c                 | 10 +++++-----
>  security/selinux/hooks.c             | 10 +++++-----
>  security/smack/smack_lsm.c           | 12 ++++++------
>  6 files changed, 20 insertions(+), 20 deletions(-)

For the LSM framework and SELinux changes ...

Acked-by: Paul Moore <paul@paul-moore.com> (LSM/SELinux)

-- 
paul-moore.com

^ permalink raw reply

* Re: [PATCH v2 049/110] security: use PRIino format for i_ino
From: Paul Moore @ 2026-03-03  2:28 UTC (permalink / raw)
  To: Jeff Layton
  Cc: Alexander Viro, Christian Brauner, Jan Kara, Steven Rostedt,
	Masami Hiramatsu, Mathieu Desnoyers, Dan Williams, Matthew Wilcox,
	Eric Biggers, Theodore Y. Ts'o, Muchun Song, Oscar Salvador,
	David Hildenbrand, David Howells, Paulo Alcantara, Andreas Dilger,
	Jan Kara, Jaegeuk Kim, Chao Yu, Trond Myklebust, Anna Schumaker,
	Chuck Lever, NeilBrown, Olga Kornievskaia, Dai Ngo, Tom Talpey,
	Steve French, Ronnie Sahlberg, Shyam Prasad N, Bharath SM,
	Alexander Aring, Ryusuke Konishi, Viacheslav Dubeyko,
	Eric Van Hensbergen, Latchesar Ionkov, Dominique Martinet,
	Christian Schoenebeck, David Sterba, Marc Dionne, Ian Kent,
	Luis de Bethencourt, Salah Triki, Tigran A. Aivazian,
	Ilya Dryomov, Alex Markuze, Jan Harkes, coda, Nicolas Pitre,
	Tyler Hicks, Amir Goldstein, Christoph Hellwig,
	John Paul Adrian Glaubitz, Yangtao Li, Mikulas Patocka,
	David Woodhouse, Richard Weinberger, Dave Kleikamp,
	Konstantin Komarov, Mark Fasheh, Joel Becker, Joseph Qi,
	Mike Marshall, Martin Brandenburg, Miklos Szeredi, Anders Larsen,
	Zhihao Cheng, Damien Le Moal, Naohiro Aota, Johannes Thumshirn,
	John Johansen, James Morris, Serge E. Hallyn, Mimi Zohar,
	Roberto Sassu, Dmitry Kasatkin, Eric Snowberg, Fan Wu,
	Stephen Smalley, Ondrej Mosnacek, Casey Schaufler, Alex Deucher,
	Christian König, David Airlie, Simona Vetter, Sumit Semwal,
	Eric Dumazet, Kuniyuki Iwashima, Paolo Abeni, Willem de Bruijn,
	David S. Miller, Jakub Kicinski, Simon Horman, Oleg Nesterov,
	Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Namhyung Kim, Mark Rutland, Alexander Shishkin, Jiri Olsa,
	Ian Rogers, Adrian Hunter, James Clark, Darrick J. Wong,
	Martin Schiller, Eric Paris, Joerg Reuter, Marcel Holtmann,
	Johan Hedberg, Luiz Augusto von Dentz, Oliver Hartkopp,
	Marc Kleine-Budde, David Ahern, Neal Cardwell, Steffen Klassert,
	Herbert Xu, Remi Denis-Courmont, Marcelo Ricardo Leitner,
	Xin Long, Magnus Karlsson, Maciej Fijalkowski, Stanislav Fomichev,
	Alexei Starovoitov, Daniel Borkmann, Jesper Dangaard Brouer,
	John Fastabend, linux-fsdevel, linux-kernel, linux-trace-kernel,
	nvdimm, fsverity, linux-mm, netfs, linux-ext4, linux-f2fs-devel,
	linux-nfs, linux-cifs, samba-technical, linux-nilfs, v9fs,
	linux-afs, autofs, ceph-devel, codalist, ecryptfs, linux-mtd,
	jfs-discussion, ntfs3, ocfs2-devel, devel, linux-unionfs,
	apparmor, linux-security-module, linux-integrity, selinux,
	amd-gfx, dri-devel, linux-media, linaro-mm-sig, netdev,
	linux-perf-users, linux-fscrypt, linux-xfs, linux-hams, linux-x25,
	audit, linux-bluetooth, linux-can, linux-sctp, bpf
In-Reply-To: <20260302-iino-u64-v2-49-e5388800dae0@kernel.org>

On Mon, Mar 2, 2026 at 3:36 PM Jeff Layton <jlayton@kernel.org> wrote:
>
> Convert security i_ino format strings to use the PRIino format
> macro in preparation for the widening of i_ino via kino_t.
>
> Also correct signed format specifiers to unsigned, since inode
> numbers are unsigned values.
>
> Signed-off-by: Jeff Layton <jlayton@kernel.org>
> ---
>  security/apparmor/apparmorfs.c       |  4 ++--
>  security/integrity/integrity_audit.c |  2 +-
>  security/ipe/audit.c                 |  2 +-
>  security/lsm_audit.c                 | 10 +++++-----
>  security/selinux/hooks.c             | 10 +++++-----
>  security/smack/smack_lsm.c           | 12 ++++++------
>  6 files changed, 20 insertions(+), 20 deletions(-)

No comment on the PRIino specifier, but the LSM framework and SELinux
changes seem complete.

Acked-by: Paul Moore <paul@paul-moore.com> (LSM/SELinux)

-- 
paul-moore.com

^ permalink raw reply

* Re: [PATCH v3 0/2] jbd2: audit and convert legacy J_ASSERT usage
From: yebin (H) @ 2026-03-03  2:11 UTC (permalink / raw)
  To: jack; +Cc: tytso, linux-ext4, linux-kernel
In-Reply-To: <20260303005502.337108-1-nikic.milos@gmail.com>

The macro `J_ASSERT_JH` is a rather troublesome implementation. There
are numerous calls to `J_ASSERT_JH` within
`jbd2_journal_commit_transaction()`, and after compilation, these may
all jump to the same address for execution, making it difficult to
determine exactly where the assertion is being triggered. If there is a
functional issue in just a single file system, using `BUG_ON` to handle
it seems a bit too aggressive.
I wonder if you all have any good ideas or suggestions.

On 2026/3/3 8:55, Milos Nikic wrote:
> Hello Jan and the ext4 team,
>
> This patch series follows up on the previous discussion regarding
> converting hard J_ASSERT panics into graceful journal aborts.
>
> In v1, we addressed a specific panic on unlock. Per Jan's suggestion,
> I have audited fs/jbd2/transaction.c for other low-hanging fruit
> where state machine invariants are enforced by J_ASSERT inside
> functions that natively support error returns.
>
> Changes in v3:
>
>      Patch 2: Added pr_err() statements inside the ambiguous WARN_ON_ONCE()
>      blocks (where multiple conditions are checked via logical OR/AND) to
>      explicitly dump the b_transaction, b_next_transaction, and
>      j_committing_transaction pointers. This provides necessary context for
>      debugging state machine corruptions from the dmesg stack trace.
>
> Changes in v2:
>
>      Patch 1: Unmodified from v1. Collected Reviewed-by tags.
>
>      Patch 2: New patch resulting from the broader audit. Systematically
>      replaces J_ASSERTs with WARN_ON_ONCE and graceful -EINVAL returns
>      across 6 core transaction lifecycle functions. Careful attention was
>      paid to ensuring spinlocks are safely dropped before triggering
>      jbd2_journal_abort(), and no memory is leaked on the error paths.
>
> Milos Nikic (2):
>    jbd2: gracefully abort instead of panicking on unlocked buffer
>    jbd2: gracefully abort on transaction state corruptions
>
>   fs/jbd2/transaction.c | 115 +++++++++++++++++++++++++++++++++---------
>   1 file changed, 91 insertions(+), 24 deletions(-)
>

^ permalink raw reply

* Re: [PATCH v2] ext4: Minor fix for ext4_split_extent_zeroout()
From: Baokun Li @ 2026-03-03  1:55 UTC (permalink / raw)
  To: Ojaswin Mujoo
  Cc: Dan Carpenter, Ritesh Harjani (IBM), linux-ext4,
	Theodore Ts'o
In-Reply-To: <20260302143811.605174-1-ojaswin@linux.ibm.com>


On 3/2/26 10:38 PM, Ojaswin Mujoo wrote:
> We missed storing the error which triggerd smatch warning:
>
> 	fs/ext4/extents.c:3369 ext4_split_extent_zeroout()
> 	warn: duplicate zero check 'err' (previous on line 3363)
>
> fs/ext4/extents.c
>     3361
>     3362         err = ext4_ext_get_access(handle, inode, path + depth);
>     3363         if (err)
>     3364                 return err;
>     3365
>     3366         ext4_ext_mark_initialized(ex);
>     3367
>     3368         ext4_ext_dirty(handle, inode, path + depth);
> --> 3369         if (err)
>     3370                 return err;
>     3371
>     3372         return 0;
>     3373 }
>
> Fix it by correctly storing the err value from ext4_ext_dirty().
>
> Link: https://lore.kernel.org/all/aYXvVgPnKltX79KE@stanley.mountain/
> Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
> Fixes: a985e07c26455 ("ext4: refactor zeroout path and handle all cases")
> Reviewed-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com>
> Signed-off-by: Ojaswin Mujoo <ojaswin@linux.ibm.com>
Looks good to me.

Reviewed-by: Baokun Li <libaokun@linux.alibaba.com>
> ---
>  fs/ext4/extents.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
> index 3630b27e4fd7..5579e0e68c0f 100644
> --- a/fs/ext4/extents.c
> +++ b/fs/ext4/extents.c
> @@ -3365,7 +3365,7 @@ static int ext4_split_extent_zeroout(handle_t *handle, struct inode *inode,
>  
>  	ext4_ext_mark_initialized(ex);
>  
> -	ext4_ext_dirty(handle, inode, path + depth);
> +	err = ext4_ext_dirty(handle, inode, path + depth);
>  	if (err)
>  		return err;
>  

^ permalink raw reply

* Re: [PATCH] ext4: rralloc - (former rotalloc) improved round-robin allocation policy
From: Theodore Tso @ 2026-03-03  1:33 UTC (permalink / raw)
  To: Mario Lohajner
  Cc: Andreas Dilger, libaokun1, adilger.kernel, linux-ext4,
	linux-kernel, yangerkun, libaokun9
In-Reply-To: <c156caec-e2c8-4b85-a135-0adecb56a859@rocketmail.com>

On Mon, Mar 02, 2026 at 09:04:44PM +0100, Mario Lohajner wrote:
> RRALLOC spreads allocation starting points across block groups to avoid
> repeated concentration under parallel load.

There are already other ways in which we spread allocations across
block groups.  You need to tell explain a specific workload where this
actually makes a difference.

Also note that in most use cases, files are written once, and read
multiple times.  So spreading blocks across different block groups is
can often be actively harmful.

> In high-concurrency testing, performance is consistently comparable to
> or occasionally better than the regular allocator. No regressions have
> been observed across tested configurations.

No regressions, and only "occasionally better" not enough of a justifiation.

What is your real life workload which is motivating your efforts?

     	     	       		      	 - Ted

^ permalink raw reply

* Re: [PATCH v2 001/110] vfs: introduce kino_t typedef and PRIino format macro
From: Theodore Tso @ 2026-03-03  1:25 UTC (permalink / raw)
  To: Jeff Layton
  Cc: Alexander Viro, Christian Brauner, Jan Kara, Steven Rostedt,
	Masami Hiramatsu, Mathieu Desnoyers, Dan Williams, Matthew Wilcox,
	Eric Biggers, Muchun Song, Oscar Salvador, David Hildenbrand,
	David Howells, Paulo Alcantara, Andreas Dilger, Jan Kara,
	Jaegeuk Kim, Chao Yu, Trond Myklebust, Anna Schumaker,
	Chuck Lever, NeilBrown, Olga Kornievskaia, Dai Ngo, Tom Talpey,
	Steve French, Ronnie Sahlberg, Shyam Prasad N, Bharath SM,
	Alexander Aring, Ryusuke Konishi, Viacheslav Dubeyko,
	Eric Van Hensbergen, Latchesar Ionkov, Dominique Martinet,
	Christian Schoenebeck, David Sterba, Marc Dionne, Ian Kent,
	Luis de Bethencourt, Salah Triki, Tigran A. Aivazian,
	Ilya Dryomov, Alex Markuze, Jan Harkes, coda, Nicolas Pitre,
	Tyler Hicks, Amir Goldstein, Christoph Hellwig,
	John Paul Adrian Glaubitz, Yangtao Li, Mikulas Patocka,
	David Woodhouse, Richard Weinberger, Dave Kleikamp,
	Konstantin Komarov, Mark Fasheh, Joel Becker, Joseph Qi,
	Mike Marshall, Martin Brandenburg, Miklos Szeredi, Anders Larsen,
	Zhihao Cheng, Damien Le Moal, Naohiro Aota, Johannes Thumshirn,
	John Johansen, Paul Moore, James Morris, Serge E. Hallyn,
	Mimi Zohar, Roberto Sassu, Dmitry Kasatkin, Eric Snowberg, Fan Wu,
	Stephen Smalley, Ondrej Mosnacek, Casey Schaufler, Alex Deucher,
	Christian König, David Airlie, Simona Vetter, Sumit Semwal,
	Eric Dumazet, Kuniyuki Iwashima, Paolo Abeni, Willem de Bruijn,
	David S. Miller, Jakub Kicinski, Simon Horman, Oleg Nesterov,
	Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Namhyung Kim, Mark Rutland, Alexander Shishkin, Jiri Olsa,
	Ian Rogers, Adrian Hunter, James Clark, Darrick J. Wong,
	Martin Schiller, Eric Paris, Joerg Reuter, Marcel Holtmann,
	Johan Hedberg, Luiz Augusto von Dentz, Oliver Hartkopp,
	Marc Kleine-Budde, David Ahern, Neal Cardwell, Steffen Klassert,
	Herbert Xu, Remi Denis-Courmont, Marcelo Ricardo Leitner,
	Xin Long, Magnus Karlsson, Maciej Fijalkowski, Stanislav Fomichev,
	Alexei Starovoitov, Daniel Borkmann, Jesper Dangaard Brouer,
	John Fastabend, linux-fsdevel, linux-kernel, linux-trace-kernel,
	nvdimm, fsverity, linux-mm, netfs, linux-ext4, linux-f2fs-devel,
	linux-nfs, linux-cifs, samba-technical, linux-nilfs, v9fs,
	linux-afs, autofs, ceph-devel, codalist, ecryptfs, linux-mtd,
	jfs-discussion, ntfs3, ocfs2-devel, devel, linux-unionfs,
	apparmor, linux-security-module, linux-integrity, selinux,
	amd-gfx, dri-devel, linux-media, linaro-mm-sig, netdev,
	linux-perf-users, linux-fscrypt, linux-xfs, linux-hams, linux-x25,
	audit, linux-bluetooth, linux-can, linux-sctp, bpf
In-Reply-To: <20260302-iino-u64-v2-1-e5388800dae0@kernel.org>

On Mon, Mar 02, 2026 at 03:23:45PM -0500, Jeff Layton wrote:
> The PRIino macro is a length modifier, not a complete format specifier.
> It is used as: "%" PRIino "u" for decimal, "%" PRIino "x" for hex, etc.
> This follows the pattern used by userspace PRIu64/PRIx64 macros.

For the record, I really hate the inttypes.h format specifiers, but I
agree that we should forward the example of the C99 spec, for better
or for worse.

That being said, the userspace PRIu64, et. al macros are complete
format specifiers, not just a length modifier.  And I think this
results in less ugly format specifiers in our kernel code.

---- cut here ---
#!/bin/sh
cat <<EOF > /tmp/blah.c
#include <inttypes.h>
#include <stdio.h>

int main(int arg, char **argv)
{
        printf("PRIu64 is %s\n", PRIu64);
        printf("PRId64 is %s\n", PRId64);
        printf("PRIx64 is %s\n", PRIx64);
        return 0;
}
EOF

clang -m32 -o /tmp/blah /tmp/blah.c
/tmp/blah
---- cut here ---

% /tmp/blah.sh
PRIu64 is llu
PRId64 is lld
PRIx64 is llx

Thanks!

						- Ted

^ permalink raw reply

* [PATCH -next v3] ext4: test if inode's all dirty pages are submitted to disk
From: Ye Bin @ 2026-03-03  1:22 UTC (permalink / raw)
  To: tytso, adilger.kernel, linux-ext4; +Cc: jack

From: Ye Bin <yebin10@huawei.com>

The commit aa373cf55099 ("writeback: stop background/kupdate works from
livelocking other works") introduced an issue where unmounting a filesystem
in a multi-logical-partition scenario could lead to batch file data loss.
This problem was not fixed until the commit d92109891f21 ("fs/writeback:
bail out if there is no more inodes for IO and queued once"). It took
considerable time to identify the root cause. Additionally, in actual
production environments, we frequently encountered file data loss after
normal system reboots. Therefore, we are adding a check in the inode
release flow to verify whether all dirty pages have been flushed to disk,
in order to determine whether the data loss is caused by a logic issue in
the filesystem code.

Signed-off-by: Ye Bin <yebin10@huawei.com>
---
 fs/ext4/inode.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index 396dc3a5d16b..d4d65593bce2 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -184,6 +184,14 @@ void ext4_evict_inode(struct inode *inode)
 	if (EXT4_I(inode)->i_flags & EXT4_EA_INODE_FL)
 		ext4_evict_ea_inode(inode);
 	if (inode->i_nlink) {
+		/*
+		 * If there's dirty page will lead to data loss, user
+		 * could see stale data.
+		 */
+		if (unlikely(!ext4_emergency_state(inode->i_sb) &&
+		    mapping_tagged(&inode->i_data, PAGECACHE_TAG_DIRTY)))
+			ext4_warning_inode(inode, "data will be lost");
+
 		truncate_inode_pages_final(&inode->i_data);
 
 		goto no_delete;
-- 
2.34.1


^ permalink raw reply related

* Re: [PATCH v3 1/2] jbd2: gracefully abort instead of panicking on unlocked buffer
From: Andreas Dilger @ 2026-03-03  1:05 UTC (permalink / raw)
  To: Milos Nikic; +Cc: jack, tytso, linux-ext4, linux-kernel, Zhang Yi
In-Reply-To: <20260303005502.337108-2-nikic.milos@gmail.com>

On Mar 2, 2026, at 17:55, Milos Nikic <nikic.milos@gmail.com> wrote:
> 
> In jbd2_journal_get_create_access(), if the caller passes an unlocked
> buffer, the code currently triggers a fatal J_ASSERT.
> 
> While an unlocked buffer here is a clear API violation and a bug in the
> caller, crashing the entire system is an overly severe response. It brings
> down the whole machine for a localized filesystem inconsistency.
> 
> Replace the J_ASSERT with a WARN_ON_ONCE to capture the offending caller's
> stack trace, and return an error (-EINVAL). This allows the journal to
> gracefully abort the transaction, protecting data integrity without
> causing a kernel panic.
> 
> Signed-off-by: Milos Nikic <nikic.milos@gmail.com>
> Reviewed-by: Zhang Yi <yi.zhang@huawei.com>
> Reviewed-by: Jan Kara <jack@suse.cz>

Reviewed-by: Andreas Dilger <adilger@dilger.ca <mailto:adilger@dilger.ca>>

> ---
> fs/jbd2/transaction.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/jbd2/transaction.c b/fs/jbd2/transaction.c
> index dca4b5d8aaaa..04d17a5f2a82 100644
> --- a/fs/jbd2/transaction.c
> +++ b/fs/jbd2/transaction.c
> @@ -1302,7 +1302,12 @@ int jbd2_journal_get_create_access(handle_t *handle, struct buffer_head *bh)
> goto out;
> }
> 
> -	J_ASSERT_JH(jh, buffer_locked(jh2bh(jh)));
> +	if (WARN_ON_ONCE(!buffer_locked(jh2bh(jh)))) {
> +		err = -EINVAL;
> +		spin_unlock(&jh->b_state_lock);
> +		jbd2_journal_abort(journal, err);
> +	goto out;
> +	}
> 
> if (jh->b_transaction == NULL) {
> /*
> -- 
> 2.53.0
> 
> 


^ permalink raw reply

* [PATCH v3 2/2] jbd2: gracefully abort on transaction state corruptions
From: Milos Nikic @ 2026-03-03  0:55 UTC (permalink / raw)
  To: jack; +Cc: tytso, linux-ext4, linux-kernel, Milos Nikic
In-Reply-To: <20260303005502.337108-1-nikic.milos@gmail.com>

Auditing the jbd2 codebase reveals several legacy J_ASSERT calls
that enforce internal state machine invariants (e.g., verifying
jh->b_transaction or jh->b_next_transaction pointers).

When these invariants are broken, the journal is in a corrupted
state. However, triggering a fatal panic brings down the entire
system for a localized filesystem error.

This patch targets a specific class of these asserts: those
residing inside functions that natively return integer error codes,
booleans, or error pointers. It replaces the hard J_ASSERTs with
WARN_ON_ONCE to capture the offending stack trace, safely drops
any held locks, gracefully aborts the journal, and returns -EINVAL.

This prevents a catastrophic kernel panic while ensuring the
corrupted journal state is safely contained and upstream callers
(like ext4 or ocfs2) can gracefully handle the aborted handle.

Functions modified in fs/jbd2/transaction.c:
- jbd2__journal_start()
- do_get_write_access()
- jbd2_journal_dirty_metadata()
- jbd2_journal_forget()
- jbd2_journal_try_to_free_buffers()
- jbd2_journal_file_inode()

Signed-off-by: Milos Nikic <nikic.milos@gmail.com>
---
 fs/jbd2/transaction.c | 108 +++++++++++++++++++++++++++++++++---------
 1 file changed, 85 insertions(+), 23 deletions(-)

diff --git a/fs/jbd2/transaction.c b/fs/jbd2/transaction.c
index 04d17a5f2a82..3cb4e524e0a6 100644
--- a/fs/jbd2/transaction.c
+++ b/fs/jbd2/transaction.c
@@ -474,7 +474,8 @@ handle_t *jbd2__journal_start(journal_t *journal, int nblocks, int rsv_blocks,
 		return ERR_PTR(-EROFS);
 
 	if (handle) {
-		J_ASSERT(handle->h_transaction->t_journal == journal);
+		if (WARN_ON_ONCE(handle->h_transaction->t_journal != journal))
+			return ERR_PTR(-EINVAL);
 		handle->h_ref++;
 		return handle;
 	}
@@ -1036,7 +1037,13 @@ do_get_write_access(handle_t *handle, struct journal_head *jh,
 	 */
 	if (!jh->b_transaction) {
 		JBUFFER_TRACE(jh, "no transaction");
-		J_ASSERT_JH(jh, !jh->b_next_transaction);
+		if (WARN_ON_ONCE(jh->b_next_transaction)) {
+			spin_unlock(&jh->b_state_lock);
+			unlock_buffer(bh);
+			error = -EINVAL;
+			jbd2_journal_abort(journal, error);
+			goto out;
+		}
 		JBUFFER_TRACE(jh, "file as BJ_Reserved");
 		/*
 		 * Make sure all stores to jh (b_modified, b_frozen_data) are
@@ -1069,13 +1076,27 @@ do_get_write_access(handle_t *handle, struct journal_head *jh,
 	 */
 	if (jh->b_frozen_data) {
 		JBUFFER_TRACE(jh, "has frozen data");
-		J_ASSERT_JH(jh, jh->b_next_transaction == NULL);
+		if (WARN_ON_ONCE(jh->b_next_transaction)) {
+			spin_unlock(&jh->b_state_lock);
+			error = -EINVAL;
+			jbd2_journal_abort(journal, error);
+			goto out;
+		}
 		goto attach_next;
 	}
 
 	JBUFFER_TRACE(jh, "owned by older transaction");
-	J_ASSERT_JH(jh, jh->b_next_transaction == NULL);
-	J_ASSERT_JH(jh, jh->b_transaction == journal->j_committing_transaction);
+	if (WARN_ON_ONCE(jh->b_next_transaction ||
+			 jh->b_transaction !=
+			 journal->j_committing_transaction)) {
+		pr_err("JBD2: %s: assertion failure: b_next_transaction=%p b_transaction=%p j_committing_transaction=%p\n",
+		       journal->j_devname, jh->b_next_transaction,
+		       jh->b_transaction, journal->j_committing_transaction);
+		spin_unlock(&jh->b_state_lock);
+		error = -EINVAL;
+		jbd2_journal_abort(journal, error);
+		goto out;
+	}
 
 	/*
 	 * There is one case we have to be very careful about.  If the
@@ -1520,8 +1541,14 @@ int jbd2_journal_dirty_metadata(handle_t *handle, struct buffer_head *bh)
 	if (data_race(jh->b_transaction != transaction &&
 	    jh->b_next_transaction != transaction)) {
 		spin_lock(&jh->b_state_lock);
-		J_ASSERT_JH(jh, jh->b_transaction == transaction ||
-				jh->b_next_transaction == transaction);
+		if (WARN_ON_ONCE(jh->b_transaction != transaction &&
+				 jh->b_next_transaction != transaction)) {
+			pr_err("JBD2: %s: assertion failure: b_transaction=%p transaction=%p b_next_transaction=%p\n",
+			       journal->j_devname, jh->b_transaction,
+			       transaction, jh->b_next_transaction);
+			ret = -EINVAL;
+			goto out_unlock_bh;
+		}
 		spin_unlock(&jh->b_state_lock);
 	}
 	if (data_race(jh->b_modified == 1)) {
@@ -1531,13 +1558,15 @@ int jbd2_journal_dirty_metadata(handle_t *handle, struct buffer_head *bh)
 			spin_lock(&jh->b_state_lock);
 			if (jh->b_transaction == transaction &&
 			    jh->b_jlist != BJ_Metadata)
-				pr_err("JBD2: assertion failure: h_type=%u "
-				       "h_line_no=%u block_no=%llu jlist=%u\n",
+				pr_err("JBD2: assertion failure: h_type=%u h_line_no=%u block_no=%llu jlist=%u\n",
 				       handle->h_type, handle->h_line_no,
 				       (unsigned long long) bh->b_blocknr,
 				       jh->b_jlist);
-			J_ASSERT_JH(jh, jh->b_transaction != transaction ||
-					jh->b_jlist == BJ_Metadata);
+			if (WARN_ON_ONCE(jh->b_transaction == transaction &&
+					 jh->b_jlist != BJ_Metadata)) {
+				ret = -EINVAL;
+				goto out_unlock_bh;
+			}
 			spin_unlock(&jh->b_state_lock);
 		}
 		goto out;
@@ -1636,7 +1665,10 @@ int jbd2_journal_dirty_metadata(handle_t *handle, struct buffer_head *bh)
 	}
 
 	/* That test should have eliminated the following case: */
-	J_ASSERT_JH(jh, jh->b_frozen_data == NULL);
+	if (WARN_ON_ONCE(jh->b_frozen_data)) {
+		ret = -EINVAL;
+		goto out_unlock_bh;
+	}
 
 	JBUFFER_TRACE(jh, "file as BJ_Metadata");
 	spin_lock(&journal->j_list_lock);
@@ -1675,6 +1707,7 @@ int jbd2_journal_forget(handle_t *handle, struct buffer_head *bh)
 	int err = 0;
 	int was_modified = 0;
 	int wait_for_writeback = 0;
+	int abort_journal = 0;
 
 	if (is_handle_aborted(handle))
 		return -EROFS;
@@ -1708,7 +1741,11 @@ int jbd2_journal_forget(handle_t *handle, struct buffer_head *bh)
 	jh->b_modified = 0;
 
 	if (jh->b_transaction == transaction) {
-		J_ASSERT_JH(jh, !jh->b_frozen_data);
+		if (WARN_ON_ONCE(jh->b_frozen_data)) {
+			err = -EINVAL;
+			abort_journal = 1;
+			goto drop;
+		}
 
 		/* If we are forgetting a buffer which is already part
 		 * of this transaction, then we can just drop it from
@@ -1747,8 +1784,11 @@ int jbd2_journal_forget(handle_t *handle, struct buffer_head *bh)
 		}
 		spin_unlock(&journal->j_list_lock);
 	} else if (jh->b_transaction) {
-		J_ASSERT_JH(jh, (jh->b_transaction ==
-				 journal->j_committing_transaction));
+		if (WARN_ON_ONCE(jh->b_transaction != journal->j_committing_transaction)) {
+			err = -EINVAL;
+			abort_journal = 1;
+			goto drop;
+		}
 		/* However, if the buffer is still owned by a prior
 		 * (committing) transaction, we can't drop it yet... */
 		JBUFFER_TRACE(jh, "belongs to older transaction");
@@ -1766,7 +1806,11 @@ int jbd2_journal_forget(handle_t *handle, struct buffer_head *bh)
 			jh->b_next_transaction = transaction;
 			spin_unlock(&journal->j_list_lock);
 		} else {
-			J_ASSERT(jh->b_next_transaction == transaction);
+			if (WARN_ON_ONCE(jh->b_next_transaction != transaction)) {
+				err = -EINVAL;
+				abort_journal = 1;
+				goto drop;
+			}
 
 			/*
 			 * only drop a reference if this transaction modified
@@ -1812,6 +1856,8 @@ int jbd2_journal_forget(handle_t *handle, struct buffer_head *bh)
 drop:
 	__brelse(bh);
 	spin_unlock(&jh->b_state_lock);
+	if (abort_journal)
+		jbd2_journal_abort(journal, err);
 	if (wait_for_writeback)
 		wait_on_buffer(bh);
 	jbd2_journal_put_journal_head(jh);
@@ -2136,7 +2182,8 @@ bool jbd2_journal_try_to_free_buffers(journal_t *journal, struct folio *folio)
 	struct buffer_head *bh;
 	bool ret = false;
 
-	J_ASSERT(folio_test_locked(folio));
+	if (WARN_ON_ONCE(!folio_test_locked(folio)))
+		return false;
 
 	head = folio_buffers(folio);
 	bh = head;
@@ -2651,6 +2698,8 @@ static int jbd2_journal_file_inode(handle_t *handle, struct jbd2_inode *jinode,
 {
 	transaction_t *transaction = handle->h_transaction;
 	journal_t *journal;
+	int err = 0;
+	int abort_transaction = 0;
 
 	if (is_handle_aborted(handle))
 		return -EROFS;
@@ -2685,20 +2734,33 @@ static int jbd2_journal_file_inode(handle_t *handle, struct jbd2_inode *jinode,
 	/* On some different transaction's list - should be
 	 * the committing one */
 	if (jinode->i_transaction) {
-		J_ASSERT(jinode->i_next_transaction == NULL);
-		J_ASSERT(jinode->i_transaction ==
-					journal->j_committing_transaction);
+		if (WARN_ON_ONCE(jinode->i_next_transaction ||
+				 jinode->i_transaction !=
+				 journal->j_committing_transaction)) {
+			pr_err("JBD2: %s: assertion failure: i_next_transaction=%p i_transaction=%p j_committing_transaction=%p\n",
+			       journal->j_devname, jinode->i_next_transaction,
+			       jinode->i_transaction,
+			       journal->j_committing_transaction);
+			err = -EINVAL;
+			abort_transaction = 1;
+			goto done;
+		}
 		jinode->i_next_transaction = transaction;
 		goto done;
 	}
 	/* Not on any transaction list... */
-	J_ASSERT(!jinode->i_next_transaction);
+	if (WARN_ON_ONCE(jinode->i_next_transaction)) {
+		err = -EINVAL;
+		abort_transaction = 1;
+		goto done;
+	}
 	jinode->i_transaction = transaction;
 	list_add(&jinode->i_list, &transaction->t_inode_list);
 done:
 	spin_unlock(&journal->j_list_lock);
-
-	return 0;
+	if (abort_transaction)
+		jbd2_journal_abort(journal, err);
+	return err;
 }
 
 int jbd2_journal_inode_ranged_write(handle_t *handle,
-- 
2.53.0


^ permalink raw reply related

* [PATCH v3 1/2] jbd2: gracefully abort instead of panicking on unlocked buffer
From: Milos Nikic @ 2026-03-03  0:55 UTC (permalink / raw)
  To: jack; +Cc: tytso, linux-ext4, linux-kernel, Milos Nikic, Zhang Yi
In-Reply-To: <20260303005502.337108-1-nikic.milos@gmail.com>

In jbd2_journal_get_create_access(), if the caller passes an unlocked
buffer, the code currently triggers a fatal J_ASSERT.

While an unlocked buffer here is a clear API violation and a bug in the
caller, crashing the entire system is an overly severe response. It brings
down the whole machine for a localized filesystem inconsistency.

Replace the J_ASSERT with a WARN_ON_ONCE to capture the offending caller's
stack trace, and return an error (-EINVAL). This allows the journal to
gracefully abort the transaction, protecting data integrity without
causing a kernel panic.

Signed-off-by: Milos Nikic <nikic.milos@gmail.com>
Reviewed-by: Zhang Yi <yi.zhang@huawei.com>
Reviewed-by: Jan Kara <jack@suse.cz>
---
 fs/jbd2/transaction.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/fs/jbd2/transaction.c b/fs/jbd2/transaction.c
index dca4b5d8aaaa..04d17a5f2a82 100644
--- a/fs/jbd2/transaction.c
+++ b/fs/jbd2/transaction.c
@@ -1302,7 +1302,12 @@ int jbd2_journal_get_create_access(handle_t *handle, struct buffer_head *bh)
 		goto out;
 	}
 
-	J_ASSERT_JH(jh, buffer_locked(jh2bh(jh)));
+	if (WARN_ON_ONCE(!buffer_locked(jh2bh(jh)))) {
+		err = -EINVAL;
+		spin_unlock(&jh->b_state_lock);
+		jbd2_journal_abort(journal, err);
+		goto out;
+	}
 
 	if (jh->b_transaction == NULL) {
 		/*
-- 
2.53.0


^ permalink raw reply related

* [PATCH v3 0/2] jbd2: audit and convert legacy J_ASSERT usage
From: Milos Nikic @ 2026-03-03  0:55 UTC (permalink / raw)
  To: jack; +Cc: tytso, linux-ext4, linux-kernel, Milos Nikic

Hello Jan and the ext4 team,

This patch series follows up on the previous discussion regarding
converting hard J_ASSERT panics into graceful journal aborts.

In v1, we addressed a specific panic on unlock. Per Jan's suggestion,
I have audited fs/jbd2/transaction.c for other low-hanging fruit
where state machine invariants are enforced by J_ASSERT inside
functions that natively support error returns.

Changes in v3:

    Patch 2: Added pr_err() statements inside the ambiguous WARN_ON_ONCE()
    blocks (where multiple conditions are checked via logical OR/AND) to
    explicitly dump the b_transaction, b_next_transaction, and
    j_committing_transaction pointers. This provides necessary context for
    debugging state machine corruptions from the dmesg stack trace.

Changes in v2:

    Patch 1: Unmodified from v1. Collected Reviewed-by tags.

    Patch 2: New patch resulting from the broader audit. Systematically
    replaces J_ASSERTs with WARN_ON_ONCE and graceful -EINVAL returns
    across 6 core transaction lifecycle functions. Careful attention was
    paid to ensuring spinlocks are safely dropped before triggering
    jbd2_journal_abort(), and no memory is leaked on the error paths.

Milos Nikic (2):
  jbd2: gracefully abort instead of panicking on unlocked buffer
  jbd2: gracefully abort on transaction state corruptions

 fs/jbd2/transaction.c | 115 +++++++++++++++++++++++++++++++++---------
 1 file changed, 91 insertions(+), 24 deletions(-)

-- 
2.53.0


^ permalink raw reply

* Re: [PATCH v2 003/110] audit: widen ino fields to u64
From: Paul Moore @ 2026-03-02 23:44 UTC (permalink / raw)
  To: Jeff Layton
  Cc: Alexander Viro, Christian Brauner, Jan Kara, Steven Rostedt,
	Masami Hiramatsu, Mathieu Desnoyers, Dan Williams, Matthew Wilcox,
	Eric Biggers, Theodore Y. Ts'o, Muchun Song, Oscar Salvador,
	David Hildenbrand, David Howells, Paulo Alcantara, Andreas Dilger,
	Jan Kara, Jaegeuk Kim, Chao Yu, Trond Myklebust, Anna Schumaker,
	Chuck Lever, NeilBrown, Olga Kornievskaia, Dai Ngo, Tom Talpey,
	Steve French, Ronnie Sahlberg, Shyam Prasad N, Bharath SM,
	Alexander Aring, Ryusuke Konishi, Viacheslav Dubeyko,
	Eric Van Hensbergen, Latchesar Ionkov, Dominique Martinet,
	Christian Schoenebeck, David Sterba, Marc Dionne, Ian Kent,
	Luis de Bethencourt, Salah Triki, Tigran A. Aivazian,
	Ilya Dryomov, Alex Markuze, Jan Harkes, coda, Nicolas Pitre,
	Tyler Hicks, Amir Goldstein, Christoph Hellwig,
	John Paul Adrian Glaubitz, Yangtao Li, Mikulas Patocka,
	David Woodhouse, Richard Weinberger, Dave Kleikamp,
	Konstantin Komarov, Mark Fasheh, Joel Becker, Joseph Qi,
	Mike Marshall, Martin Brandenburg, Miklos Szeredi, Anders Larsen,
	Zhihao Cheng, Damien Le Moal, Naohiro Aota, Johannes Thumshirn,
	John Johansen, James Morris, Serge E. Hallyn, Mimi Zohar,
	Roberto Sassu, Dmitry Kasatkin, Eric Snowberg, Fan Wu,
	Stephen Smalley, Ondrej Mosnacek, Casey Schaufler, Alex Deucher,
	Christian König, David Airlie, Simona Vetter, Sumit Semwal,
	Eric Dumazet, Kuniyuki Iwashima, Paolo Abeni, Willem de Bruijn,
	David S. Miller, Jakub Kicinski, Simon Horman, Oleg Nesterov,
	Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Namhyung Kim, Mark Rutland, Alexander Shishkin, Jiri Olsa,
	Ian Rogers, Adrian Hunter, James Clark, Darrick J. Wong,
	Martin Schiller, Eric Paris, Joerg Reuter, Marcel Holtmann,
	Johan Hedberg, Luiz Augusto von Dentz, Oliver Hartkopp,
	Marc Kleine-Budde, David Ahern, Neal Cardwell, Steffen Klassert,
	Herbert Xu, Remi Denis-Courmont, Marcelo Ricardo Leitner,
	Xin Long, Magnus Karlsson, Maciej Fijalkowski, Stanislav Fomichev,
	Alexei Starovoitov, Daniel Borkmann, Jesper Dangaard Brouer,
	John Fastabend, linux-fsdevel, linux-kernel, linux-trace-kernel,
	nvdimm, fsverity, linux-mm, netfs, linux-ext4, linux-f2fs-devel,
	linux-nfs, linux-cifs, samba-technical, linux-nilfs, v9fs,
	linux-afs, autofs, ceph-devel, codalist, ecryptfs, linux-mtd,
	jfs-discussion, ntfs3, ocfs2-devel, devel, linux-unionfs,
	apparmor, linux-security-module, linux-integrity, selinux,
	amd-gfx, dri-devel, linux-media, linaro-mm-sig, netdev,
	linux-perf-users, linux-fscrypt, linux-xfs, linux-hams, linux-x25,
	audit, linux-bluetooth, linux-can, linux-sctp, bpf
In-Reply-To: <20260302-iino-u64-v2-3-e5388800dae0@kernel.org>

On Mon, Mar 2, 2026 at 3:25 PM Jeff Layton <jlayton@kernel.org> wrote:
>
> inode->i_ino is being widened from unsigned long to u64. The audit
> subsystem uses unsigned long ino in struct fields, function parameters,
> and local variables that store inode numbers from arbitrary filesystems.
> On 32-bit platforms this truncates inode numbers that exceed 32 bits,
> which will cause incorrect audit log entries and broken watch/mark
> comparisons.
>
> Widen all audit ino fields, parameters, and locals to u64, and update
> the inode format string from %lu to %llu to match.
>
> Signed-off-by: Jeff Layton <jlayton@kernel.org>
> ---
>  include/linux/audit.h   | 2 +-
>  kernel/audit.h          | 9 ++++-----
>  kernel/audit_fsnotify.c | 4 ++--
>  kernel/audit_watch.c    | 8 ++++----
>  kernel/auditsc.c        | 2 +-
>  5 files changed, 12 insertions(+), 13 deletions(-)

We should also update audit_hash_ino() in kernel/audit.h.  It is a
*very* basic hash function, so I think leaving the function as-is and
just changing the inode parameter from u32 to u64 should be fine.

-- 
paul-moore.com

^ permalink raw reply

* Re: [PATCH v2 2/2] jbd2: gracefully abort on transaction state corruptions
From: Andreas Dilger @ 2026-03-02 23:19 UTC (permalink / raw)
  To: Milos Nikic; +Cc: jack, tytso, linux-ext4, linux-kernel
In-Reply-To: <20260302213425.273187-3-nikic.milos@gmail.com>

On Mar 2, 2026, at 14:34, Milos Nikic <nikic.milos@gmail.com> wrote:
> 
> Auditing the jbd2 codebase reveals several legacy J_ASSERT calls
> that enforce internal state machine invariants (e.g., verifying
> jh->b_transaction or jh->b_next_transaction pointers).
> 
> When these invariants are broken, the journal is in a corrupted
> state. However, triggering a fatal panic brings down the entire
> system for a localized filesystem error.
> 
> This patch targets a specific class of these asserts: those
> residing inside functions that natively return integer error codes,
> booleans, or error pointers. It replaces the hard J_ASSERTs with
> WARN_ON_ONCE to capture the offending stack trace, safely drops
> any held locks, gracefully aborts the journal, and returns -EINVAL.
> 
> This prevents a catastrophic kernel panic while ensuring the
> corrupted journal state is safely contained and upstream callers
> (like ext4 or ocfs2) can gracefully handle the aborted handle.
> 
> Functions modified in fs/jbd2/transaction.c:
> - jbd2__journal_start()
> - do_get_write_access()
> - jbd2_journal_dirty_metadata()
> - jbd2_journal_forget()
> - jbd2_journal_try_to_free_buffers()
> - jbd2_journal_file_inode()
> 
> Signed-off-by: Milos Nikic <nikic.milos@gmail.com>

Looks good, though a minor suggestion for some of the replacements.
 
Reviewed-by: Andreas Dilger <adilger@dilger.ca <mailto:adilger@dilger.ca>>

> @@ -1069,13 +1076,24 @@ do_get_write_access(handle_t *handle, struct 
>  	JBUFFER_TRACE(jh, "owned by older transaction");
> -	J_ASSERT_JH(jh, jh->b_next_transaction == NULL);
> -	J_ASSERT_JH(jh, jh->b_transaction == journal->j_committing_transaction);
> +	if (WARN_ON_ONCE(jh->b_next_transaction ||
> +			 jh->b_transaction !=
> +			 journal->j_committing_transaction)) {
> +		spin_unlock(&jh->b_state_lock);
> +		error = -EINVAL;
> +		jbd2_journal_abort(journal, error);
> +		goto out;
> +	}

In cases like this where you are checking multiple conditions in a
single WARN_ON_ONCE() it isn't possible to know which condition
failed.  It would be better to add a pr_err() in the failure case to
print b_next_transaction, j_committing_transaction, and b_transaction
so it is easier to debug if this is ever hit.

Cheers, Andreas


^ permalink raw reply

* Re: [PATCH v2 100/110] zonefs: replace PRIino with %llu/%llx format strings
From: Damien Le Moal @ 2026-03-02 22:58 UTC (permalink / raw)
  To: Jeff Layton, Alexander Viro, Christian Brauner, Jan Kara,
	Steven Rostedt, Masami Hiramatsu, Mathieu Desnoyers, Dan Williams,
	Matthew Wilcox, Eric Biggers, Theodore Y. Ts'o, Muchun Song,
	Oscar Salvador, David Hildenbrand, David Howells, Paulo Alcantara,
	Andreas Dilger, Jan Kara, Jaegeuk Kim, Chao Yu, Trond Myklebust,
	Anna Schumaker, Chuck Lever, NeilBrown, Olga Kornievskaia,
	Dai Ngo, Tom Talpey, Steve French, Ronnie Sahlberg,
	Shyam Prasad N, Bharath SM, Alexander Aring, Ryusuke Konishi,
	Viacheslav Dubeyko, Eric Van Hensbergen, Latchesar Ionkov,
	Dominique Martinet, Christian Schoenebeck, David Sterba,
	Marc Dionne, Ian Kent, Luis de Bethencourt, Salah Triki,
	Tigran A. Aivazian, Ilya Dryomov, Alex Markuze, Jan Harkes, coda,
	Nicolas Pitre, Tyler Hicks, Amir Goldstein, Christoph Hellwig,
	John Paul Adrian Glaubitz, Yangtao Li, Mikulas Patocka,
	David Woodhouse, Richard Weinberger, Dave Kleikamp,
	Konstantin Komarov, Mark Fasheh, Joel Becker, Joseph Qi,
	Mike Marshall, Martin Brandenburg, Miklos Szeredi, Anders Larsen,
	Zhihao Cheng, Naohiro Aota, Johannes Thumshirn, John Johansen,
	Paul Moore, James Morris, Serge E. Hallyn, Mimi Zohar,
	Roberto Sassu, Dmitry Kasatkin, Eric Snowberg, Fan Wu,
	Stephen Smalley, Ondrej Mosnacek, Casey Schaufler, Alex Deucher,
	Christian König, David Airlie, Simona Vetter, Sumit Semwal,
	Eric Dumazet, Kuniyuki Iwashima, Paolo Abeni, Willem de Bruijn,
	David S. Miller, Jakub Kicinski, Simon Horman, Oleg Nesterov,
	Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Namhyung Kim, Mark Rutland, Alexander Shishkin, Jiri Olsa,
	Ian Rogers, Adrian Hunter, James Clark, Darrick J. Wong,
	Martin Schiller, Eric Paris, Joerg Reuter, Marcel Holtmann,
	Johan Hedberg, Luiz Augusto von Dentz, Oliver Hartkopp,
	Marc Kleine-Budde, David Ahern, Neal Cardwell, Steffen Klassert,
	Herbert Xu, Remi Denis-Courmont, Marcelo Ricardo Leitner,
	Xin Long, Magnus Karlsson, Maciej Fijalkowski, Stanislav Fomichev,
	Alexei Starovoitov, Daniel Borkmann, Jesper Dangaard Brouer,
	John Fastabend
  Cc: linux-fsdevel, linux-kernel, linux-trace-kernel, nvdimm, fsverity,
	linux-mm, netfs, linux-ext4, linux-f2fs-devel, linux-nfs,
	linux-cifs, samba-technical, linux-nilfs, v9fs, linux-afs, autofs,
	ceph-devel, codalist, ecryptfs, linux-mtd, jfs-discussion, ntfs3,
	ocfs2-devel, devel, linux-unionfs, apparmor,
	linux-security-module, linux-integrity, selinux, amd-gfx,
	dri-devel, linux-media, linaro-mm-sig, netdev, linux-perf-users,
	linux-fscrypt, linux-xfs, linux-hams, linux-x25, audit,
	linux-bluetooth, linux-can, linux-sctp, bpf
In-Reply-To: <20260302-iino-u64-v2-100-e5388800dae0@kernel.org>

On 3/3/26 05:25, Jeff Layton wrote:
> Now that i_ino is u64 and the PRIino format macro has been removed,
> replace all uses in zonefs with the concrete format strings.
> 
> Signed-off-by: Jeff Layton <jlayton@kernel.org>

Acked-by: Damien Le Moal <dlemoal@kernel.org>

-- 
Damien Le Moal
Western Digital Research

^ permalink raw reply

* Re: [PATCH v2 048/110] zonefs: use PRIino format for i_ino
From: Damien Le Moal @ 2026-03-02 22:57 UTC (permalink / raw)
  To: Jeff Layton, Alexander Viro, Christian Brauner, Jan Kara,
	Steven Rostedt, Masami Hiramatsu, Mathieu Desnoyers, Dan Williams,
	Matthew Wilcox, Eric Biggers, Theodore Y. Ts'o, Muchun Song,
	Oscar Salvador, David Hildenbrand, David Howells, Paulo Alcantara,
	Andreas Dilger, Jan Kara, Jaegeuk Kim, Chao Yu, Trond Myklebust,
	Anna Schumaker, Chuck Lever, NeilBrown, Olga Kornievskaia,
	Dai Ngo, Tom Talpey, Steve French, Ronnie Sahlberg,
	Shyam Prasad N, Bharath SM, Alexander Aring, Ryusuke Konishi,
	Viacheslav Dubeyko, Eric Van Hensbergen, Latchesar Ionkov,
	Dominique Martinet, Christian Schoenebeck, David Sterba,
	Marc Dionne, Ian Kent, Luis de Bethencourt, Salah Triki,
	Tigran A. Aivazian, Ilya Dryomov, Alex Markuze, Jan Harkes, coda,
	Nicolas Pitre, Tyler Hicks, Amir Goldstein, Christoph Hellwig,
	John Paul Adrian Glaubitz, Yangtao Li, Mikulas Patocka,
	David Woodhouse, Richard Weinberger, Dave Kleikamp,
	Konstantin Komarov, Mark Fasheh, Joel Becker, Joseph Qi,
	Mike Marshall, Martin Brandenburg, Miklos Szeredi, Anders Larsen,
	Zhihao Cheng, Naohiro Aota, Johannes Thumshirn, John Johansen,
	Paul Moore, James Morris, Serge E. Hallyn, Mimi Zohar,
	Roberto Sassu, Dmitry Kasatkin, Eric Snowberg, Fan Wu,
	Stephen Smalley, Ondrej Mosnacek, Casey Schaufler, Alex Deucher,
	Christian König, David Airlie, Simona Vetter, Sumit Semwal,
	Eric Dumazet, Kuniyuki Iwashima, Paolo Abeni, Willem de Bruijn,
	David S. Miller, Jakub Kicinski, Simon Horman, Oleg Nesterov,
	Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Namhyung Kim, Mark Rutland, Alexander Shishkin, Jiri Olsa,
	Ian Rogers, Adrian Hunter, James Clark, Darrick J. Wong,
	Martin Schiller, Eric Paris, Joerg Reuter, Marcel Holtmann,
	Johan Hedberg, Luiz Augusto von Dentz, Oliver Hartkopp,
	Marc Kleine-Budde, David Ahern, Neal Cardwell, Steffen Klassert,
	Herbert Xu, Remi Denis-Courmont, Marcelo Ricardo Leitner,
	Xin Long, Magnus Karlsson, Maciej Fijalkowski, Stanislav Fomichev,
	Alexei Starovoitov, Daniel Borkmann, Jesper Dangaard Brouer,
	John Fastabend
  Cc: linux-fsdevel, linux-kernel, linux-trace-kernel, nvdimm, fsverity,
	linux-mm, netfs, linux-ext4, linux-f2fs-devel, linux-nfs,
	linux-cifs, samba-technical, linux-nilfs, v9fs, linux-afs, autofs,
	ceph-devel, codalist, ecryptfs, linux-mtd, jfs-discussion, ntfs3,
	ocfs2-devel, devel, linux-unionfs, apparmor,
	linux-security-module, linux-integrity, selinux, amd-gfx,
	dri-devel, linux-media, linaro-mm-sig, netdev, linux-perf-users,
	linux-fscrypt, linux-xfs, linux-hams, linux-x25, audit,
	linux-bluetooth, linux-can, linux-sctp, bpf
In-Reply-To: <20260302-iino-u64-v2-48-e5388800dae0@kernel.org>

On 3/3/26 05:24, Jeff Layton wrote:
> Convert zonefs i_ino format strings to use the PRIino format
> macro in preparation for the widening of i_ino via kino_t.
> 
> Signed-off-by: Jeff Layton <jlayton@kernel.org>

Acked-by: Damien Le Moal <dlemoal@kernel.org>


-- 
Damien Le Moal
Western Digital Research

^ permalink raw reply

* Re:  [PATCH v2 084/110] hfs: replace PRIino with %llu/%llx format strings
From: Viacheslav Dubeyko @ 2026-03-02 22:40 UTC (permalink / raw)
  To: socketcan@hartkopp.net, herbert@gondor.apana.org.au,
	jolsa@kernel.org, jreuter@yaina.de, Dai.Ngo@oracle.com,
	Ondrej Mosnacek, davem@davemloft.net, dlemoal@kernel.org,
	trondmy@kernel.org, namhyung@kernel.org,
	almaz.alexandrovich@paragon-software.com, miklos@szeredi.hu,
	john.johansen@canonical.com, stephen.smalley.work@gmail.com,
	nico@fluxnic.net, maciej.fijalkowski@intel.com, Olga Kornievskaia,
	amir73il@gmail.com, tom@talpey.com, joseph.qi@linux.alibaba.com,
	paul@paul-moore.com, asmadeus@codewreck.org,
	alexander.shishkin@linux.intel.com, mark@fasheh.com,
	linux_oss@crudebyte.com, alexander.deucher@amd.com,
	viro@zeniv.linux.org.uk, willy@infradead.org, ebiggers@kernel.org,
	lucien.xin@gmail.com, bharathsm@microsoft.com,
	marcel@holtmann.org, sumit.semwal@linaro.org, Eric Paris,
	djwong@kernel.org, simona@ffwll.ch, hawk@kernel.org,
	mark.rutland@arm.com, james.clark@linaro.org,
	john.fastabend@gmail.com, dsterba@suse.com, kuniyu@google.com,
	hch@infradead.org, luiz.dentz@gmail.com, daniel@iogearbox.net,
	dwmw2@infradead.org, ncardwell@google.com, sprasad@microsoft.com,
	marcelo.leitner@gmail.com, edumazet@google.com,
	rostedt@goodmis.org, jack@suse.com, mhiramat@kernel.org,
	frank.li@vivo.com, alex.aring@gmail.com, luisbg@kernel.org,
	ms@dev.tdt.de, jth@kernel.org, jlbec@evilplan.org,
	aivazian.tigran@gmail.com, anna@kernel.org, peterz@infradead.org,
	tytso@mit.edu, willemb@google.com, eric.snowberg@oracle.com,
	johan.hedberg@gmail.com, acme@kernel.org,
	ronniesahlberg@gmail.com, jaharkes@cs.cmu.edu, David Howells,
	jaegeuk@kernel.org, courmisch@gmail.com, martin@omnibond.com,
	christian.koenig@amd.com, jmorris@namei.org,
	adilger.kernel@dilger.ca, idryomov@gmail.com, brauner@kernel.org,
	Paolo Abeni, glaubitz@physik.fu-berlin.de,
	magnus.karlsson@intel.com, airlied@gmail.com, coda@cs.cmu.edu,
	casey@schaufler-ca.com, raven@themaw.net, horms@kernel.org,
	adrian.hunter@intel.com, kuba@kernel.org, muchun.song@linux.dev,
	chao@kernel.org, mathieu.desnoyers@efficios.com,
	hubcap@omnibond.com, jlayton@kernel.org, sdf@fomichev.me,
	roberto.sassu@huawei.com, Alex Markuze, chengzhihao1@huawei.com,
	mikulas@artax.karlin.mff.cuni.cz, ericvh@kernel.org,
	salah.triki@gmail.com, osalvador@suse.de,
	dmitry.kasatkin@gmail.com, sfrench@samba.org, serge@hallyn.com,
	wufan@kernel.org, al@alarsen.net, pc@manguebit.org,
	ast@kernel.org, oleg@redhat.com, slava@dubeyko.com,
	konishi.ryusuke@gmail.com, lucho@ionkov.net, dsahern@kernel.org,
	shaggy@kernel.org, richard@nod.at, marc.dionne@auristor.com,
	neil@brown.name, dan.j.williams@intel.com, mkl@pengutronix.de,
	david@kernel.org, Ingo Molnar, jack@suse.cz, code@tyhicks.com,
	steffen.klassert@secunet.com, naohiro.aota@wdc.com,
	zohar@linux.ibm.com, chuck.lever@oracle.com, irogers@google.com
  Cc: linux-sctp@vger.kernel.org, ecryptfs@vger.kernel.org,
	linux-unionfs@vger.kernel.org, apparmor@lists.ubuntu.com,
	linux-ext4@vger.kernel.org, autofs@vger.kernel.org,
	amd-gfx@lists.freedesktop.org, fsverity@lists.linux.dev,
	ntfs3@lists.linux.dev, ocfs2-devel@lists.linux.dev,
	linux-fsdevel@vger.kernel.org, linux-media@vger.kernel.org,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
	linux-integrity@vger.kernel.org, samba-technical@lists.samba.org,
	linux-nilfs@vger.kernel.org, audit@vger.kernel.org,
	selinux@vger.kernel.org, linaro-mm-sig@lists.linaro.org,
	linux-trace-kernel@vger.kernel.org, v9fs@lists.linux.dev,
	linux-xfs@vger.kernel.org, linux-x25@vger.kernel.org,
	linux-f2fs-devel@lists.sourceforge.net,
	linux-bluetooth@vger.kernel.org, nvdimm@lists.linux.dev,
	ceph-devel@vger.kernel.org, jfs-discussion@lists.sourceforge.net,
	linux-mtd@lists.infradead.org, devel@lists.orangefs.org,
	linux-afs@lists.infradead.org, linux-fscrypt@vger.kernel.org,
	linux-security-module@vger.kernel.org, linux-cifs@vger.kernel.org,
	linux-hams@vger.kernel.org, bpf@vger.kernel.org,
	linux-can@vger.kernel.org, linux-nfs@vger.kernel.org,
	codalist@coda.cs.cmu.edu, linux-mm@kvack.org,
	netfs@lists.linux.dev, linux-perf-users@vger.kernel.org,
	dri-devel@lists.freedesktop.org
In-Reply-To: <20260302-iino-u64-v2-84-e5388800dae0@kernel.org>

On Mon, 2026-03-02 at 15:25 -0500, Jeff Layton wrote:
> Now that i_ino is u64 and the PRIino format macro has been removed,
> replace all uses in hfs with the concrete format strings.
> 
> Signed-off-by: Jeff Layton <jlayton@kernel.org>
> ---
>  fs/hfs/catalog.c | 2 +-
>  fs/hfs/extent.c  | 4 ++--
>  fs/hfs/inode.c   | 4 ++--
>  3 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/fs/hfs/catalog.c b/fs/hfs/catalog.c
> index b07c0a3ffc61584165e8cc9f646de6066a6ad2c9..7f5339ee57c15aae2d5d00474133a985be3af6ca 100644
> --- a/fs/hfs/catalog.c
> +++ b/fs/hfs/catalog.c
> @@ -417,7 +417,7 @@ int hfs_cat_move(u32 cnid, struct inode *src_dir, const struct qstr *src_name,
>  	int entry_size, type;
>  	int err;
>  
> -	hfs_dbg("cnid %u - (ino %" PRIino "u, name %s) - (ino %" PRIino "u, name %s)\n",
> +	hfs_dbg("cnid %u - (ino %llu, name %s) - (ino %llu, name %s)\n",
>  		cnid, src_dir->i_ino, src_name->name,
>  		dst_dir->i_ino, dst_name->name);
>  	sb = src_dir->i_sb;
> diff --git a/fs/hfs/extent.c b/fs/hfs/extent.c
> index 60875cc23880b758bbbb5e4b8281d9ee1f2dbcbb..f066a99a863bc739948aac921bc906874c6009b2 100644
> --- a/fs/hfs/extent.c
> +++ b/fs/hfs/extent.c
> @@ -411,7 +411,7 @@ int hfs_extend_file(struct inode *inode)
>  		goto out;
>  	}
>  
> -	hfs_dbg("ino %" PRIino "u, start %u, len %u\n", inode->i_ino, start, len);
> +	hfs_dbg("ino %llu, start %u, len %u\n", inode->i_ino, start, len);
>  	if (HFS_I(inode)->alloc_blocks == HFS_I(inode)->first_blocks) {
>  		if (!HFS_I(inode)->first_blocks) {
>  			hfs_dbg("first_extent: start %u, len %u\n",
> @@ -482,7 +482,7 @@ void hfs_file_truncate(struct inode *inode)
>  	u32 size;
>  	int res;
>  
> -	hfs_dbg("ino %" PRIino "u, phys_size %llu -> i_size %llu\n",
> +	hfs_dbg("ino %llu, phys_size %llu -> i_size %llu\n",
>  		inode->i_ino, (long long)HFS_I(inode)->phys_size,
>  		inode->i_size);
>  	if (inode->i_size > HFS_I(inode)->phys_size) {
> diff --git a/fs/hfs/inode.c b/fs/hfs/inode.c
> index b19866525c1e9c43decf3a943c709922ee8630f6..95f0333a608b0fb57239cf5eec7d9489a25efb3a 100644
> --- a/fs/hfs/inode.c
> +++ b/fs/hfs/inode.c
> @@ -270,7 +270,7 @@ void hfs_delete_inode(struct inode *inode)
>  {
>  	struct super_block *sb = inode->i_sb;
>  
> -	hfs_dbg("ino %" PRIino "u\n", inode->i_ino);
> +	hfs_dbg("ino %llu\n", inode->i_ino);
>  	if (S_ISDIR(inode->i_mode)) {
>  		atomic64_dec(&HFS_SB(sb)->folder_count);
>  		if (HFS_I(inode)->cat_key.ParID == cpu_to_be32(HFS_ROOT_CNID))
> @@ -455,7 +455,7 @@ int hfs_write_inode(struct inode *inode, struct writeback_control *wbc)
>  	hfs_cat_rec rec;
>  	int res;
>  
> -	hfs_dbg("ino %" PRIino "u\n", inode->i_ino);
> +	hfs_dbg("ino %llu\n", inode->i_ino);
>  	res = hfs_ext_write_extent(inode);
>  	if (res)
>  		return res;

Reviewed-by: Viacheslav Dubeyko <slava@dubeyko.com>

Thanks,
Slava.

^ permalink raw reply

* Re:  [PATCH v2 076/110] ceph: replace PRIino with %llu/%llx format strings
From: Viacheslav Dubeyko @ 2026-03-02 22:39 UTC (permalink / raw)
  To: socketcan@hartkopp.net, herbert@gondor.apana.org.au,
	jolsa@kernel.org, jreuter@yaina.de, Dai.Ngo@oracle.com,
	Ondrej Mosnacek, davem@davemloft.net, dlemoal@kernel.org,
	trondmy@kernel.org, namhyung@kernel.org,
	almaz.alexandrovich@paragon-software.com, miklos@szeredi.hu,
	john.johansen@canonical.com, stephen.smalley.work@gmail.com,
	nico@fluxnic.net, maciej.fijalkowski@intel.com, Olga Kornievskaia,
	amir73il@gmail.com, tom@talpey.com, joseph.qi@linux.alibaba.com,
	paul@paul-moore.com, asmadeus@codewreck.org,
	alexander.shishkin@linux.intel.com, mark@fasheh.com,
	linux_oss@crudebyte.com, alexander.deucher@amd.com,
	viro@zeniv.linux.org.uk, willy@infradead.org, ebiggers@kernel.org,
	lucien.xin@gmail.com, bharathsm@microsoft.com,
	marcel@holtmann.org, sumit.semwal@linaro.org, Eric Paris,
	djwong@kernel.org, simona@ffwll.ch, hawk@kernel.org,
	mark.rutland@arm.com, james.clark@linaro.org,
	john.fastabend@gmail.com, dsterba@suse.com, kuniyu@google.com,
	hch@infradead.org, luiz.dentz@gmail.com, daniel@iogearbox.net,
	dwmw2@infradead.org, ncardwell@google.com, sprasad@microsoft.com,
	marcelo.leitner@gmail.com, edumazet@google.com,
	rostedt@goodmis.org, jack@suse.com, mhiramat@kernel.org,
	frank.li@vivo.com, alex.aring@gmail.com, luisbg@kernel.org,
	ms@dev.tdt.de, jth@kernel.org, jlbec@evilplan.org,
	aivazian.tigran@gmail.com, anna@kernel.org, peterz@infradead.org,
	tytso@mit.edu, willemb@google.com, eric.snowberg@oracle.com,
	johan.hedberg@gmail.com, acme@kernel.org,
	ronniesahlberg@gmail.com, jaharkes@cs.cmu.edu, David Howells,
	jaegeuk@kernel.org, courmisch@gmail.com, martin@omnibond.com,
	christian.koenig@amd.com, jmorris@namei.org,
	adilger.kernel@dilger.ca, idryomov@gmail.com, brauner@kernel.org,
	Paolo Abeni, glaubitz@physik.fu-berlin.de,
	magnus.karlsson@intel.com, airlied@gmail.com, coda@cs.cmu.edu,
	casey@schaufler-ca.com, raven@themaw.net, horms@kernel.org,
	adrian.hunter@intel.com, kuba@kernel.org, muchun.song@linux.dev,
	chao@kernel.org, mathieu.desnoyers@efficios.com,
	hubcap@omnibond.com, jlayton@kernel.org, sdf@fomichev.me,
	roberto.sassu@huawei.com, Alex Markuze, chengzhihao1@huawei.com,
	mikulas@artax.karlin.mff.cuni.cz, ericvh@kernel.org,
	salah.triki@gmail.com, osalvador@suse.de,
	dmitry.kasatkin@gmail.com, sfrench@samba.org, serge@hallyn.com,
	wufan@kernel.org, al@alarsen.net, pc@manguebit.org,
	ast@kernel.org, oleg@redhat.com, slava@dubeyko.com,
	konishi.ryusuke@gmail.com, lucho@ionkov.net, dsahern@kernel.org,
	shaggy@kernel.org, richard@nod.at, marc.dionne@auristor.com,
	neil@brown.name, dan.j.williams@intel.com, mkl@pengutronix.de,
	david@kernel.org, Ingo Molnar, jack@suse.cz, code@tyhicks.com,
	steffen.klassert@secunet.com, naohiro.aota@wdc.com,
	zohar@linux.ibm.com, chuck.lever@oracle.com, irogers@google.com
  Cc: linux-sctp@vger.kernel.org, ecryptfs@vger.kernel.org,
	linux-unionfs@vger.kernel.org, apparmor@lists.ubuntu.com,
	linux-ext4@vger.kernel.org, autofs@vger.kernel.org,
	amd-gfx@lists.freedesktop.org, fsverity@lists.linux.dev,
	ntfs3@lists.linux.dev, ocfs2-devel@lists.linux.dev,
	linux-fsdevel@vger.kernel.org, linux-media@vger.kernel.org,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
	linux-integrity@vger.kernel.org, samba-technical@lists.samba.org,
	linux-nilfs@vger.kernel.org, audit@vger.kernel.org,
	selinux@vger.kernel.org, linaro-mm-sig@lists.linaro.org,
	linux-trace-kernel@vger.kernel.org, v9fs@lists.linux.dev,
	linux-xfs@vger.kernel.org, linux-x25@vger.kernel.org,
	linux-f2fs-devel@lists.sourceforge.net,
	linux-bluetooth@vger.kernel.org, nvdimm@lists.linux.dev,
	ceph-devel@vger.kernel.org, jfs-discussion@lists.sourceforge.net,
	linux-mtd@lists.infradead.org, devel@lists.orangefs.org,
	linux-afs@lists.infradead.org, linux-fscrypt@vger.kernel.org,
	linux-security-module@vger.kernel.org, linux-cifs@vger.kernel.org,
	linux-hams@vger.kernel.org, bpf@vger.kernel.org,
	linux-can@vger.kernel.org, linux-nfs@vger.kernel.org,
	codalist@coda.cs.cmu.edu, linux-mm@kvack.org,
	netfs@lists.linux.dev, linux-perf-users@vger.kernel.org,
	dri-devel@lists.freedesktop.org
In-Reply-To: <20260302-iino-u64-v2-76-e5388800dae0@kernel.org>

On Mon, 2026-03-02 at 15:25 -0500, Jeff Layton wrote:
> Now that i_ino is u64 and the PRIino format macro has been removed,
> replace all uses in ceph with the concrete format strings.
> 
> Signed-off-by: Jeff Layton <jlayton@kernel.org>
> ---
>  fs/ceph/crypto.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/ceph/crypto.c b/fs/ceph/crypto.c
> index 718c194ba5d8ce22c6a5d1dd687ec3761263e7e1..64d2407592772ed61fb95b62401db194112f48a8 100644
> --- a/fs/ceph/crypto.c
> +++ b/fs/ceph/crypto.c
> @@ -272,7 +272,7 @@ int ceph_encode_encrypted_dname(struct inode *parent, char *buf, int elen)
>  	/* To understand the 240 limit, see CEPH_NOHASH_NAME_MAX comments */
>  	WARN_ON(elen > 240);
>  	if (dir != parent) // leading _ is already there; append _<inum>
> -		elen += 1 + sprintf(p + elen, "_%" PRIino "u", dir->i_ino);
> +		elen += 1 + sprintf(p + elen, "_%llu", dir->i_ino);
>  
>  out:
>  	kfree(cryptbuf);
> @@ -377,7 +377,7 @@ int ceph_fname_to_usr(const struct ceph_fname *fname, struct fscrypt_str *tname,
>  	if (!ret && (dir != fname->dir)) {
>  		char tmp_buf[BASE64_CHARS(NAME_MAX)];
>  
> -		name_len = snprintf(tmp_buf, sizeof(tmp_buf), "_%.*s_%" PRIino "u",
> +		name_len = snprintf(tmp_buf, sizeof(tmp_buf), "_%.*s_%llu",
>  				    oname->len, oname->name, dir->i_ino);
>  		memcpy(oname->name, tmp_buf, name_len);
>  		oname->len = name_len;

Reviewed-by: Viacheslav Dubeyko <Slava.Dubeyko@ibm.com>

Thanks,
Slava.

^ permalink raw reply

* Re:  [PATCH v2 068/110] nilfs2: replace PRIino with %llu/%llx format strings
From: Viacheslav Dubeyko @ 2026-03-02 22:38 UTC (permalink / raw)
  To: socketcan@hartkopp.net, herbert@gondor.apana.org.au,
	jolsa@kernel.org, jreuter@yaina.de, Dai.Ngo@oracle.com,
	Ondrej Mosnacek, davem@davemloft.net, dlemoal@kernel.org,
	trondmy@kernel.org, namhyung@kernel.org,
	almaz.alexandrovich@paragon-software.com, miklos@szeredi.hu,
	john.johansen@canonical.com, stephen.smalley.work@gmail.com,
	nico@fluxnic.net, maciej.fijalkowski@intel.com, Olga Kornievskaia,
	amir73il@gmail.com, tom@talpey.com, joseph.qi@linux.alibaba.com,
	paul@paul-moore.com, asmadeus@codewreck.org,
	alexander.shishkin@linux.intel.com, mark@fasheh.com,
	linux_oss@crudebyte.com, alexander.deucher@amd.com,
	viro@zeniv.linux.org.uk, willy@infradead.org, ebiggers@kernel.org,
	lucien.xin@gmail.com, bharathsm@microsoft.com,
	marcel@holtmann.org, sumit.semwal@linaro.org, Eric Paris,
	djwong@kernel.org, simona@ffwll.ch, hawk@kernel.org,
	mark.rutland@arm.com, james.clark@linaro.org,
	john.fastabend@gmail.com, dsterba@suse.com, kuniyu@google.com,
	hch@infradead.org, luiz.dentz@gmail.com, daniel@iogearbox.net,
	dwmw2@infradead.org, ncardwell@google.com, sprasad@microsoft.com,
	marcelo.leitner@gmail.com, edumazet@google.com,
	rostedt@goodmis.org, jack@suse.com, mhiramat@kernel.org,
	frank.li@vivo.com, alex.aring@gmail.com, luisbg@kernel.org,
	ms@dev.tdt.de, jth@kernel.org, jlbec@evilplan.org,
	aivazian.tigran@gmail.com, anna@kernel.org, peterz@infradead.org,
	tytso@mit.edu, willemb@google.com, eric.snowberg@oracle.com,
	johan.hedberg@gmail.com, acme@kernel.org,
	ronniesahlberg@gmail.com, jaharkes@cs.cmu.edu, David Howells,
	jaegeuk@kernel.org, courmisch@gmail.com, martin@omnibond.com,
	christian.koenig@amd.com, jmorris@namei.org,
	adilger.kernel@dilger.ca, idryomov@gmail.com, brauner@kernel.org,
	Paolo Abeni, glaubitz@physik.fu-berlin.de,
	magnus.karlsson@intel.com, airlied@gmail.com, coda@cs.cmu.edu,
	casey@schaufler-ca.com, raven@themaw.net, horms@kernel.org,
	adrian.hunter@intel.com, kuba@kernel.org, muchun.song@linux.dev,
	chao@kernel.org, mathieu.desnoyers@efficios.com,
	hubcap@omnibond.com, jlayton@kernel.org, sdf@fomichev.me,
	roberto.sassu@huawei.com, Alex Markuze, chengzhihao1@huawei.com,
	mikulas@artax.karlin.mff.cuni.cz, ericvh@kernel.org,
	salah.triki@gmail.com, osalvador@suse.de,
	dmitry.kasatkin@gmail.com, sfrench@samba.org, serge@hallyn.com,
	wufan@kernel.org, al@alarsen.net, pc@manguebit.org,
	ast@kernel.org, oleg@redhat.com, slava@dubeyko.com,
	konishi.ryusuke@gmail.com, lucho@ionkov.net, dsahern@kernel.org,
	shaggy@kernel.org, richard@nod.at, marc.dionne@auristor.com,
	neil@brown.name, dan.j.williams@intel.com, mkl@pengutronix.de,
	david@kernel.org, Ingo Molnar, jack@suse.cz, code@tyhicks.com,
	steffen.klassert@secunet.com, naohiro.aota@wdc.com,
	zohar@linux.ibm.com, chuck.lever@oracle.com, irogers@google.com
  Cc: linux-sctp@vger.kernel.org, ecryptfs@vger.kernel.org,
	linux-unionfs@vger.kernel.org, apparmor@lists.ubuntu.com,
	linux-ext4@vger.kernel.org, autofs@vger.kernel.org,
	amd-gfx@lists.freedesktop.org, fsverity@lists.linux.dev,
	ntfs3@lists.linux.dev, ocfs2-devel@lists.linux.dev,
	linux-fsdevel@vger.kernel.org, linux-media@vger.kernel.org,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
	linux-integrity@vger.kernel.org, samba-technical@lists.samba.org,
	linux-nilfs@vger.kernel.org, audit@vger.kernel.org,
	selinux@vger.kernel.org, linaro-mm-sig@lists.linaro.org,
	linux-trace-kernel@vger.kernel.org, v9fs@lists.linux.dev,
	linux-xfs@vger.kernel.org, linux-x25@vger.kernel.org,
	linux-f2fs-devel@lists.sourceforge.net,
	linux-bluetooth@vger.kernel.org, nvdimm@lists.linux.dev,
	ceph-devel@vger.kernel.org, jfs-discussion@lists.sourceforge.net,
	linux-mtd@lists.infradead.org, devel@lists.orangefs.org,
	linux-afs@lists.infradead.org, linux-fscrypt@vger.kernel.org,
	linux-security-module@vger.kernel.org, linux-cifs@vger.kernel.org,
	linux-hams@vger.kernel.org, bpf@vger.kernel.org,
	linux-can@vger.kernel.org, linux-nfs@vger.kernel.org,
	codalist@coda.cs.cmu.edu, linux-mm@kvack.org,
	netfs@lists.linux.dev, linux-perf-users@vger.kernel.org,
	dri-devel@lists.freedesktop.org
In-Reply-To: <20260302-iino-u64-v2-68-e5388800dae0@kernel.org>

On Mon, 2026-03-02 at 15:24 -0500, Jeff Layton wrote:
> Now that i_ino is u64 and the PRIino format macro has been removed,
> replace all uses in nilfs2 with the concrete format strings.
> 
> Signed-off-by: Jeff Layton <jlayton@kernel.org>
> ---
>  fs/nilfs2/alloc.c   | 10 +++++-----
>  fs/nilfs2/bmap.c    |  2 +-
>  fs/nilfs2/btnode.c  |  2 +-
>  fs/nilfs2/btree.c   | 12 ++++++------
>  fs/nilfs2/dir.c     | 12 ++++++------
>  fs/nilfs2/direct.c  |  4 ++--
>  fs/nilfs2/gcinode.c |  2 +-
>  fs/nilfs2/inode.c   |  8 ++++----
>  fs/nilfs2/mdt.c     |  2 +-
>  fs/nilfs2/namei.c   |  2 +-
>  fs/nilfs2/segment.c |  2 +-
>  11 files changed, 29 insertions(+), 29 deletions(-)
> 
> diff --git a/fs/nilfs2/alloc.c b/fs/nilfs2/alloc.c
> index a3c559c86e5a4c63b1c9dd4ca137f24749c3ee87..7b1cd2baefcf21e54f9260845b02c7c95c148c64 100644
> --- a/fs/nilfs2/alloc.c
> +++ b/fs/nilfs2/alloc.c
> @@ -707,7 +707,7 @@ void nilfs_palloc_commit_free_entry(struct inode *inode,
>  
>  	if (!nilfs_clear_bit_atomic(lock, group_offset, bitmap))
>  		nilfs_warn(inode->i_sb,
> -			   "%s (ino=%" PRIino "u): entry number %llu already freed",
> +			   "%s (ino=%llu): entry number %llu already freed",
>  			   __func__, inode->i_ino,
>  			   (unsigned long long)req->pr_entry_nr);
>  	else
> @@ -748,7 +748,7 @@ void nilfs_palloc_abort_alloc_entry(struct inode *inode,
>  
>  	if (!nilfs_clear_bit_atomic(lock, group_offset, bitmap))
>  		nilfs_warn(inode->i_sb,
> -			   "%s (ino=%" PRIino "u): entry number %llu already freed",
> +			   "%s (ino=%llu): entry number %llu already freed",
>  			   __func__, inode->i_ino,
>  			   (unsigned long long)req->pr_entry_nr);
>  	else
> @@ -861,7 +861,7 @@ int nilfs_palloc_freev(struct inode *inode, __u64 *entry_nrs, size_t nitems)
>  			if (!nilfs_clear_bit_atomic(lock, group_offset,
>  						    bitmap)) {
>  				nilfs_warn(inode->i_sb,
> -					   "%s (ino=%" PRIino "u): entry number %llu already freed",
> +					   "%s (ino=%llu): entry number %llu already freed",
>  					   __func__, inode->i_ino,
>  					   (unsigned long long)entry_nrs[j]);
>  			} else {
> @@ -906,7 +906,7 @@ int nilfs_palloc_freev(struct inode *inode, __u64 *entry_nrs, size_t nitems)
>  							      last_nrs[k]);
>  			if (ret && ret != -ENOENT)
>  				nilfs_warn(inode->i_sb,
> -					   "error %d deleting block that object (entry=%llu, ino=%" PRIino "u) belongs to",
> +					   "error %d deleting block that object (entry=%llu, ino=%llu) belongs to",
>  					   ret, (unsigned long long)last_nrs[k],
>  					   inode->i_ino);
>  		}
> @@ -923,7 +923,7 @@ int nilfs_palloc_freev(struct inode *inode, __u64 *entry_nrs, size_t nitems)
>  			ret = nilfs_palloc_delete_bitmap_block(inode, group);
>  			if (ret && ret != -ENOENT)
>  				nilfs_warn(inode->i_sb,
> -					   "error %d deleting bitmap block of group=%lu, ino=%" PRIino "u",
> +					   "error %d deleting bitmap block of group=%lu, ino=%llu",
>  					   ret, group, inode->i_ino);
>  		}
>  	}
> diff --git a/fs/nilfs2/bmap.c b/fs/nilfs2/bmap.c
> index e12979bac3c3ee5eb7fcc2bf156fe6e48fc65a7d..824f2bd91c167965ec3a660202b6e6c5f1fe007e 100644
> --- a/fs/nilfs2/bmap.c
> +++ b/fs/nilfs2/bmap.c
> @@ -33,7 +33,7 @@ static int nilfs_bmap_convert_error(struct nilfs_bmap *bmap,
>  
>  	if (err == -EINVAL) {
>  		__nilfs_error(inode->i_sb, fname,
> -			      "broken bmap (inode number=%" PRIino "u)", inode->i_ino);
> +			      "broken bmap (inode number=%llu)", inode->i_ino);
>  		err = -EIO;
>  	}
>  	return err;
> diff --git a/fs/nilfs2/btnode.c b/fs/nilfs2/btnode.c
> index 3d64f3a9223e5601dc2332ae6e1007edd5b4827b..2e553d698d0f3980de98fced415dfd819ddbca0a 100644
> --- a/fs/nilfs2/btnode.c
> +++ b/fs/nilfs2/btnode.c
> @@ -64,7 +64,7 @@ nilfs_btnode_create_block(struct address_space *btnc, __u64 blocknr)
>  		 * clearing of an abandoned b-tree node is missing somewhere).
>  		 */
>  		nilfs_error(inode->i_sb,
> -			    "state inconsistency probably due to duplicate use of b-tree node block address %llu (ino=%" PRIino "u)",
> +			    "state inconsistency probably due to duplicate use of b-tree node block address %llu (ino=%llu)",
>  			    (unsigned long long)blocknr, inode->i_ino);
>  		goto failed;
>  	}
> diff --git a/fs/nilfs2/btree.c b/fs/nilfs2/btree.c
> index 57163e991fbc49e2bfba2fa543f1b8dbd77718f4..3c03f5a741d144d22d1ffb5acf43a035e88c00dc 100644
> --- a/fs/nilfs2/btree.c
> +++ b/fs/nilfs2/btree.c
> @@ -353,7 +353,7 @@ static int nilfs_btree_node_broken(const struct nilfs_btree_node *node,
>  		     nchildren <= 0 ||
>  		     nchildren > NILFS_BTREE_NODE_NCHILDREN_MAX(size))) {
>  		nilfs_crit(inode->i_sb,
> -			   "bad btree node (ino=%" PRIino "u, blocknr=%llu): level = %d, flags = 0x%x, nchildren = %d",
> +			   "bad btree node (ino=%llu, blocknr=%llu): level = %d, flags = 0x%x, nchildren = %d",
>  			   inode->i_ino, (unsigned long long)blocknr, level,
>  			   flags, nchildren);
>  		ret = 1;
> @@ -384,7 +384,7 @@ static int nilfs_btree_root_broken(const struct nilfs_btree_node *node,
>  		     nchildren > NILFS_BTREE_ROOT_NCHILDREN_MAX ||
>  		     (nchildren == 0 && level > NILFS_BTREE_LEVEL_NODE_MIN))) {
>  		nilfs_crit(inode->i_sb,
> -			   "bad btree root (ino=%" PRIino "u): level = %d, flags = 0x%x, nchildren = %d",
> +			   "bad btree root (ino=%llu): level = %d, flags = 0x%x, nchildren = %d",
>  			   inode->i_ino, level, flags, nchildren);
>  		ret = 1;
>  	}
> @@ -453,7 +453,7 @@ static int nilfs_btree_bad_node(const struct nilfs_bmap *btree,
>  	if (unlikely(nilfs_btree_node_get_level(node) != level)) {
>  		dump_stack();
>  		nilfs_crit(btree->b_inode->i_sb,
> -			   "btree level mismatch (ino=%" PRIino "u): %d != %d",
> +			   "btree level mismatch (ino=%llu): %d != %d",
>  			   btree->b_inode->i_ino,
>  			   nilfs_btree_node_get_level(node), level);
>  		return 1;
> @@ -521,7 +521,7 @@ static int __nilfs_btree_get_block(const struct nilfs_bmap *btree, __u64 ptr,
>   out_no_wait:
>  	if (!buffer_uptodate(bh)) {
>  		nilfs_err(btree->b_inode->i_sb,
> -			  "I/O error reading b-tree node block (ino=%" PRIino "u, blocknr=%llu)",
> +			  "I/O error reading b-tree node block (ino=%llu, blocknr=%llu)",
>  			  btree->b_inode->i_ino, (unsigned long long)ptr);
>  		brelse(bh);
>  		return -EIO;
> @@ -2104,7 +2104,7 @@ static int nilfs_btree_propagate(struct nilfs_bmap *btree,
>  	if (ret < 0) {
>  		if (unlikely(ret == -ENOENT)) {
>  			nilfs_crit(btree->b_inode->i_sb,
> -				   "writing node/leaf block does not appear in b-tree (ino=%" PRIino "u) at key=%llu, level=%d",
> +				   "writing node/leaf block does not appear in b-tree (ino=%llu) at key=%llu, level=%d",
>  				   btree->b_inode->i_ino,
>  				   (unsigned long long)key, level);
>  			ret = -EINVAL;
> @@ -2146,7 +2146,7 @@ static void nilfs_btree_add_dirty_buffer(struct nilfs_bmap *btree,
>  	    level >= NILFS_BTREE_LEVEL_MAX) {
>  		dump_stack();
>  		nilfs_warn(btree->b_inode->i_sb,
> -			   "invalid btree level: %d (key=%llu, ino=%" PRIino "u, blocknr=%llu)",
> +			   "invalid btree level: %d (key=%llu, ino=%llu, blocknr=%llu)",
>  			   level, (unsigned long long)key,
>  			   btree->b_inode->i_ino,
>  			   (unsigned long long)bh->b_blocknr);
> diff --git a/fs/nilfs2/dir.c b/fs/nilfs2/dir.c
> index b182da076c58c4813145bc3e501a1e9a188bce85..3653db5cdb65137d1e660bb509c14ec4cbc8840b 100644
> --- a/fs/nilfs2/dir.c
> +++ b/fs/nilfs2/dir.c
> @@ -150,7 +150,7 @@ static bool nilfs_check_folio(struct folio *folio, char *kaddr)
>  
>  Ebadsize:
>  	nilfs_error(sb,
> -		    "size of directory #%" PRIino "u is not a multiple of chunk size",
> +		    "size of directory #%llu is not a multiple of chunk size",
>  		    dir->i_ino);
>  	goto fail;
>  Eshort:
> @@ -169,7 +169,7 @@ static bool nilfs_check_folio(struct folio *folio, char *kaddr)
>  	error = "disallowed inode number";
>  bad_entry:
>  	nilfs_error(sb,
> -		    "bad entry in directory #%" PRIino "u: %s - offset=%lu, inode=%lu, rec_len=%zd, name_len=%d",
> +		    "bad entry in directory #%llu: %s - offset=%lu, inode=%lu, rec_len=%zd, name_len=%d",
>  		    dir->i_ino, error, (folio->index << PAGE_SHIFT) + offs,
>  		    (unsigned long)le64_to_cpu(p->inode),
>  		    rec_len, p->name_len);
> @@ -177,7 +177,7 @@ static bool nilfs_check_folio(struct folio *folio, char *kaddr)
>  Eend:
>  	p = (struct nilfs_dir_entry *)(kaddr + offs);
>  	nilfs_error(sb,
> -		    "entry in directory #%" PRIino "u spans the page boundary offset=%lu, inode=%lu",
> +		    "entry in directory #%llu spans the page boundary offset=%lu, inode=%lu",
>  		    dir->i_ino, (folio->index << PAGE_SHIFT) + offs,
>  		    (unsigned long)le64_to_cpu(p->inode));
>  fail:
> @@ -251,7 +251,7 @@ static int nilfs_readdir(struct file *file, struct dir_context *ctx)
>  
>  		kaddr = nilfs_get_folio(inode, n, &folio);
>  		if (IS_ERR(kaddr)) {
> -			nilfs_error(sb, "bad page in #%" PRIino "u", inode->i_ino);
> +			nilfs_error(sb, "bad page in #%llu", inode->i_ino);
>  			ctx->pos += PAGE_SIZE - offset;
>  			return -EIO;
>  		}
> @@ -336,7 +336,7 @@ struct nilfs_dir_entry *nilfs_find_entry(struct inode *dir,
>  		/* next folio is past the blocks we've got */
>  		if (unlikely(n > (dir->i_blocks >> (PAGE_SHIFT - 9)))) {
>  			nilfs_error(dir->i_sb,
> -			       "dir %" PRIino "u size %lld exceeds block count %llu",
> +			       "dir %llu size %lld exceeds block count %llu",
>  			       dir->i_ino, dir->i_size,
>  			       (unsigned long long)dir->i_blocks);
>  			goto out;
> @@ -382,7 +382,7 @@ struct nilfs_dir_entry *nilfs_dotdot(struct inode *dir, struct folio **foliop)
>  	return next_de;
>  
>  fail:
> -	nilfs_error(dir->i_sb, "directory #%" PRIino "u %s", dir->i_ino, msg);
> +	nilfs_error(dir->i_sb, "directory #%llu %s", dir->i_ino, msg);
>  	folio_release_kmap(folio, de);
>  	return NULL;
>  }
> diff --git a/fs/nilfs2/direct.c b/fs/nilfs2/direct.c
> index 1084d4d586e078ab6825167976dd2a71d52bc8aa..8bd0b1374e25f8ff510f3b36dbde2acc01aafc1e 100644
> --- a/fs/nilfs2/direct.c
> +++ b/fs/nilfs2/direct.c
> @@ -338,7 +338,7 @@ static int nilfs_direct_assign(struct nilfs_bmap *bmap,
>  	key = nilfs_bmap_data_get_key(bmap, *bh);
>  	if (unlikely(key > NILFS_DIRECT_KEY_MAX)) {
>  		nilfs_crit(bmap->b_inode->i_sb,
> -			   "%s (ino=%" PRIino "u): invalid key: %llu",
> +			   "%s (ino=%llu): invalid key: %llu",
>  			   __func__,
>  			   bmap->b_inode->i_ino, (unsigned long long)key);
>  		return -EINVAL;
> @@ -346,7 +346,7 @@ static int nilfs_direct_assign(struct nilfs_bmap *bmap,
>  	ptr = nilfs_direct_get_ptr(bmap, key);
>  	if (unlikely(ptr == NILFS_BMAP_INVALID_PTR)) {
>  		nilfs_crit(bmap->b_inode->i_sb,
> -			   "%s (ino=%" PRIino "u): invalid pointer: %llu",
> +			   "%s (ino=%llu): invalid pointer: %llu",
>  			   __func__,
>  			   bmap->b_inode->i_ino, (unsigned long long)ptr);
>  		return -EINVAL;
> diff --git a/fs/nilfs2/gcinode.c b/fs/nilfs2/gcinode.c
> index 714962d010da4a23e9b5f40de8aaaca8b95a74da..62d4c1b787e95c961a360a4214d621d564ad8b4c 100644
> --- a/fs/nilfs2/gcinode.c
> +++ b/fs/nilfs2/gcinode.c
> @@ -137,7 +137,7 @@ int nilfs_gccache_wait_and_mark_dirty(struct buffer_head *bh)
>  		struct inode *inode = bh->b_folio->mapping->host;
>  
>  		nilfs_err(inode->i_sb,
> -			  "I/O error reading %s block for GC (ino=%" PRIino "u, vblocknr=%llu)",
> +			  "I/O error reading %s block for GC (ino=%llu, vblocknr=%llu)",
>  			  buffer_nilfs_node(bh) ? "node" : "data",
>  			  inode->i_ino, (unsigned long long)bh->b_blocknr);
>  		return -EIO;
> diff --git a/fs/nilfs2/inode.c b/fs/nilfs2/inode.c
> index 0bc1c5141ec596b3c31e7d18e4ba3541bf618406..51f7e125a311b868860e3e111700d49d4cb98fa6 100644
> --- a/fs/nilfs2/inode.c
> +++ b/fs/nilfs2/inode.c
> @@ -108,7 +108,7 @@ int nilfs_get_block(struct inode *inode, sector_t blkoff,
>  				 * be locked in this case.
>  				 */
>  				nilfs_warn(inode->i_sb,
> -					   "%s (ino=%" PRIino "u): a race condition while inserting a data block at offset=%llu",
> +					   "%s (ino=%llu): a race condition while inserting a data block at offset=%llu",
>  					   __func__, inode->i_ino,
>  					   (unsigned long long)blkoff);
>  				err = -EAGAIN;
> @@ -789,7 +789,7 @@ static void nilfs_truncate_bmap(struct nilfs_inode_info *ii,
>  		goto repeat;
>  
>  failed:
> -	nilfs_warn(ii->vfs_inode.i_sb, "error %d truncating bmap (ino=%" PRIino "u)",
> +	nilfs_warn(ii->vfs_inode.i_sb, "error %d truncating bmap (ino=%llu)",
>  		   ret, ii->vfs_inode.i_ino);
>  }
>  
> @@ -1026,7 +1026,7 @@ int nilfs_set_file_dirty(struct inode *inode, unsigned int nr_dirty)
>  			 * this inode.
>  			 */
>  			nilfs_warn(inode->i_sb,
> -				   "cannot set file dirty (ino=%" PRIino "u): the file is being freed",
> +				   "cannot set file dirty (ino=%llu): the file is being freed",
>  				   inode->i_ino);
>  			spin_unlock(&nilfs->ns_inode_lock);
>  			return -EINVAL; /*
> @@ -1057,7 +1057,7 @@ int __nilfs_mark_inode_dirty(struct inode *inode, int flags)
>  	err = nilfs_load_inode_block(inode, &ibh);
>  	if (unlikely(err)) {
>  		nilfs_warn(inode->i_sb,
> -			   "cannot mark inode dirty (ino=%" PRIino "u): error %d loading inode block",
> +			   "cannot mark inode dirty (ino=%llu): error %d loading inode block",
>  			   inode->i_ino, err);
>  		return err;
>  	}
> diff --git a/fs/nilfs2/mdt.c b/fs/nilfs2/mdt.c
> index 8629c72b62db33217d4747124885b6f727f182be..09adb40c65e505d92012a3d2f5fe8a5696e10056 100644
> --- a/fs/nilfs2/mdt.c
> +++ b/fs/nilfs2/mdt.c
> @@ -203,7 +203,7 @@ static int nilfs_mdt_read_block(struct inode *inode, unsigned long block,
>  	err = -EIO;
>  	if (!buffer_uptodate(first_bh)) {
>  		nilfs_err(inode->i_sb,
> -			  "I/O error reading meta-data file (ino=%" PRIino "u, block-offset=%lu)",
> +			  "I/O error reading meta-data file (ino=%llu, block-offset=%lu)",
>  			  inode->i_ino, block);
>  		goto failed_bh;
>  	}
> diff --git a/fs/nilfs2/namei.c b/fs/nilfs2/namei.c
> index 29edb84a0663caa4b29fa488c0495fc53358ca00..40ac679ec56e400b1df98e9be6fe9ca338a9ba51 100644
> --- a/fs/nilfs2/namei.c
> +++ b/fs/nilfs2/namei.c
> @@ -292,7 +292,7 @@ static int nilfs_do_unlink(struct inode *dir, struct dentry *dentry)
>  
>  	if (!inode->i_nlink) {
>  		nilfs_warn(inode->i_sb,
> -			   "deleting nonexistent file (ino=%" PRIino "u), %d",
> +			   "deleting nonexistent file (ino=%llu), %d",
>  			   inode->i_ino, inode->i_nlink);
>  		set_nlink(inode, 1);
>  	}
> diff --git a/fs/nilfs2/segment.c b/fs/nilfs2/segment.c
> index 9a8bc3fa35ce9b447abbc2fb56cbd2b0cc5f76de..4b1bf559f3524b1cc3965dae9fd3e5745718569d 100644
> --- a/fs/nilfs2/segment.c
> +++ b/fs/nilfs2/segment.c
> @@ -2024,7 +2024,7 @@ static int nilfs_segctor_collect_dirty_files(struct nilfs_sc_info *sci,
>  				ifile, ii->vfs_inode.i_ino, &ibh);
>  			if (unlikely(err)) {
>  				nilfs_warn(sci->sc_super,
> -					   "log writer: error %d getting inode block (ino=%" PRIino "u)",
> +					   "log writer: error %d getting inode block (ino=%llu)",
>  					   err, ii->vfs_inode.i_ino);
>  				return err;
>  			}

Reviewed-by: Viacheslav Dubeyko <slava@dubeyko.com>

Thanks,
Slava.


^ permalink raw reply

* Re:  [PATCH v2 032/110] hfsplus: use PRIino format for i_ino
From: Viacheslav Dubeyko @ 2026-03-02 22:36 UTC (permalink / raw)
  To: socketcan@hartkopp.net, herbert@gondor.apana.org.au,
	jolsa@kernel.org, jreuter@yaina.de, Dai.Ngo@oracle.com,
	Ondrej Mosnacek, davem@davemloft.net, dlemoal@kernel.org,
	trondmy@kernel.org, namhyung@kernel.org,
	almaz.alexandrovich@paragon-software.com, miklos@szeredi.hu,
	john.johansen@canonical.com, stephen.smalley.work@gmail.com,
	nico@fluxnic.net, maciej.fijalkowski@intel.com, Olga Kornievskaia,
	amir73il@gmail.com, tom@talpey.com, joseph.qi@linux.alibaba.com,
	paul@paul-moore.com, asmadeus@codewreck.org,
	alexander.shishkin@linux.intel.com, mark@fasheh.com,
	linux_oss@crudebyte.com, alexander.deucher@amd.com,
	viro@zeniv.linux.org.uk, willy@infradead.org, ebiggers@kernel.org,
	lucien.xin@gmail.com, bharathsm@microsoft.com,
	marcel@holtmann.org, sumit.semwal@linaro.org, Eric Paris,
	djwong@kernel.org, simona@ffwll.ch, hawk@kernel.org,
	mark.rutland@arm.com, james.clark@linaro.org,
	john.fastabend@gmail.com, dsterba@suse.com, kuniyu@google.com,
	hch@infradead.org, luiz.dentz@gmail.com, daniel@iogearbox.net,
	dwmw2@infradead.org, ncardwell@google.com, sprasad@microsoft.com,
	marcelo.leitner@gmail.com, edumazet@google.com,
	rostedt@goodmis.org, jack@suse.com, mhiramat@kernel.org,
	frank.li@vivo.com, alex.aring@gmail.com, luisbg@kernel.org,
	ms@dev.tdt.de, jth@kernel.org, jlbec@evilplan.org,
	aivazian.tigran@gmail.com, anna@kernel.org, peterz@infradead.org,
	tytso@mit.edu, willemb@google.com, eric.snowberg@oracle.com,
	johan.hedberg@gmail.com, acme@kernel.org,
	ronniesahlberg@gmail.com, jaharkes@cs.cmu.edu, David Howells,
	jaegeuk@kernel.org, courmisch@gmail.com, martin@omnibond.com,
	christian.koenig@amd.com, jmorris@namei.org,
	adilger.kernel@dilger.ca, idryomov@gmail.com, brauner@kernel.org,
	Paolo Abeni, glaubitz@physik.fu-berlin.de,
	magnus.karlsson@intel.com, airlied@gmail.com, coda@cs.cmu.edu,
	casey@schaufler-ca.com, raven@themaw.net, horms@kernel.org,
	adrian.hunter@intel.com, kuba@kernel.org, muchun.song@linux.dev,
	chao@kernel.org, mathieu.desnoyers@efficios.com,
	hubcap@omnibond.com, jlayton@kernel.org, sdf@fomichev.me,
	roberto.sassu@huawei.com, Alex Markuze, chengzhihao1@huawei.com,
	mikulas@artax.karlin.mff.cuni.cz, ericvh@kernel.org,
	salah.triki@gmail.com, osalvador@suse.de,
	dmitry.kasatkin@gmail.com, sfrench@samba.org, serge@hallyn.com,
	wufan@kernel.org, al@alarsen.net, pc@manguebit.org,
	ast@kernel.org, oleg@redhat.com, slava@dubeyko.com,
	konishi.ryusuke@gmail.com, lucho@ionkov.net, dsahern@kernel.org,
	shaggy@kernel.org, richard@nod.at, marc.dionne@auristor.com,
	neil@brown.name, dan.j.williams@intel.com, mkl@pengutronix.de,
	david@kernel.org, Ingo Molnar, jack@suse.cz, code@tyhicks.com,
	steffen.klassert@secunet.com, naohiro.aota@wdc.com,
	zohar@linux.ibm.com, chuck.lever@oracle.com, irogers@google.com
  Cc: linux-sctp@vger.kernel.org, ecryptfs@vger.kernel.org,
	linux-unionfs@vger.kernel.org, apparmor@lists.ubuntu.com,
	linux-ext4@vger.kernel.org, autofs@vger.kernel.org,
	amd-gfx@lists.freedesktop.org, fsverity@lists.linux.dev,
	ntfs3@lists.linux.dev, ocfs2-devel@lists.linux.dev,
	linux-fsdevel@vger.kernel.org, linux-media@vger.kernel.org,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
	linux-integrity@vger.kernel.org, samba-technical@lists.samba.org,
	linux-nilfs@vger.kernel.org, audit@vger.kernel.org,
	selinux@vger.kernel.org, linaro-mm-sig@lists.linaro.org,
	linux-trace-kernel@vger.kernel.org, v9fs@lists.linux.dev,
	linux-xfs@vger.kernel.org, linux-x25@vger.kernel.org,
	linux-f2fs-devel@lists.sourceforge.net,
	linux-bluetooth@vger.kernel.org, nvdimm@lists.linux.dev,
	ceph-devel@vger.kernel.org, jfs-discussion@lists.sourceforge.net,
	linux-mtd@lists.infradead.org, devel@lists.orangefs.org,
	linux-afs@lists.infradead.org, linux-fscrypt@vger.kernel.org,
	linux-security-module@vger.kernel.org, linux-cifs@vger.kernel.org,
	linux-hams@vger.kernel.org, bpf@vger.kernel.org,
	linux-can@vger.kernel.org, linux-nfs@vger.kernel.org,
	codalist@coda.cs.cmu.edu, linux-mm@kvack.org,
	netfs@lists.linux.dev, linux-perf-users@vger.kernel.org,
	dri-devel@lists.freedesktop.org
In-Reply-To: <20260302-iino-u64-v2-32-e5388800dae0@kernel.org>

On Mon, 2026-03-02 at 15:24 -0500, Jeff Layton wrote:
> Convert hfsplus i_ino format strings to use the PRIino format
> macro in preparation for the widening of i_ino via kino_t.
> 
> Also correct signed format specifiers to unsigned, since inode
> numbers are unsigned values.
> 
> Signed-off-by: Jeff Layton <jlayton@kernel.org>
> ---
>  fs/hfsplus/attributes.c | 10 +++++-----
>  fs/hfsplus/catalog.c    |  2 +-
>  fs/hfsplus/dir.c        |  6 +++---
>  fs/hfsplus/extents.c    |  6 +++---
>  fs/hfsplus/inode.c      |  8 ++++----
>  fs/hfsplus/super.c      |  6 +++---
>  fs/hfsplus/xattr.c      | 10 +++++-----
>  7 files changed, 24 insertions(+), 24 deletions(-)
> 
> diff --git a/fs/hfsplus/attributes.c b/fs/hfsplus/attributes.c
> index 4b79cd606276e31c20fa18ef3a099596f50e8a0f..d0b3f58166a057c0a5bf2e41cf6fc839798c0ded 100644
> --- a/fs/hfsplus/attributes.c
> +++ b/fs/hfsplus/attributes.c
> @@ -203,7 +203,7 @@ int hfsplus_create_attr_nolock(struct inode *inode, const char *name,
>  	int entry_size;
>  	int err;
>  
> -	hfs_dbg("name %s, ino %ld\n",
> +	hfs_dbg("name %s, ino %" PRIino "u\n",
>  		name ? name : NULL, inode->i_ino);
>  
>  	if (name) {
> @@ -255,7 +255,7 @@ int hfsplus_create_attr(struct inode *inode,
>  	hfsplus_attr_entry *entry_ptr;
>  	int err;
>  
> -	hfs_dbg("name %s, ino %ld\n",
> +	hfs_dbg("name %s, ino %" PRIino "u\n",
>  		name ? name : NULL, inode->i_ino);
>  
>  	if (!HFSPLUS_SB(sb)->attr_tree) {
> @@ -337,7 +337,7 @@ int hfsplus_delete_attr_nolock(struct inode *inode, const char *name,
>  	struct super_block *sb = inode->i_sb;
>  	int err;
>  
> -	hfs_dbg("name %s, ino %ld\n",
> +	hfs_dbg("name %s, ino %" PRIino "u\n",
>  		name ? name : NULL, inode->i_ino);
>  
>  	if (name) {
> @@ -367,7 +367,7 @@ int hfsplus_delete_attr(struct inode *inode, const char *name)
>  	struct super_block *sb = inode->i_sb;
>  	struct hfs_find_data fd;
>  
> -	hfs_dbg("name %s, ino %ld\n",
> +	hfs_dbg("name %s, ino %" PRIino "u\n",
>  		name ? name : NULL, inode->i_ino);
>  
>  	if (!HFSPLUS_SB(sb)->attr_tree) {
> @@ -436,7 +436,7 @@ int hfsplus_replace_attr(struct inode *inode,
>  	hfsplus_attr_entry *entry_ptr;
>  	int err = 0;
>  
> -	hfs_dbg("name %s, ino %ld\n",
> +	hfs_dbg("name %s, ino %" PRIino "u\n",
>  		name ? name : NULL, inode->i_ino);
>  
>  	if (!HFSPLUS_SB(sb)->attr_tree) {
> diff --git a/fs/hfsplus/catalog.c b/fs/hfsplus/catalog.c
> index 02c1eee4a4b86059ceaab7a7c68ab65adba6fa26..d422f117c60dee6fd8ece0d01d4ce66e04421e4a 100644
> --- a/fs/hfsplus/catalog.c
> +++ b/fs/hfsplus/catalog.c
> @@ -441,7 +441,7 @@ int hfsplus_rename_cat(u32 cnid,
>  	int entry_size, type;
>  	int err;
>  
> -	hfs_dbg("cnid %u - ino %lu, name %s - ino %lu, name %s\n",
> +	hfs_dbg("cnid %u - ino %" PRIino "u, name %s - ino %" PRIino "u, name %s\n",
>  		cnid, src_dir->i_ino, src_name->name,
>  		dst_dir->i_ino, dst_name->name);
>  	err = hfs_find_init(HFSPLUS_SB(sb)->cat_tree, &src_fd);
> diff --git a/fs/hfsplus/dir.c b/fs/hfsplus/dir.c
> index d559bf8625f853d50fd316d157cf8afe22069565..e701b11437f09172f88d68b4e4f5998591572b38 100644
> --- a/fs/hfsplus/dir.c
> +++ b/fs/hfsplus/dir.c
> @@ -313,7 +313,7 @@ static int hfsplus_link(struct dentry *src_dentry, struct inode *dst_dir,
>  	if (!S_ISREG(inode->i_mode))
>  		return -EPERM;
>  
> -	hfs_dbg("src_dir->i_ino %lu, dst_dir->i_ino %lu, inode->i_ino %lu\n",
> +	hfs_dbg("src_dir->i_ino %" PRIino "u, dst_dir->i_ino %" PRIino "u, inode->i_ino %" PRIino "u\n",
>  		src_dir->i_ino, dst_dir->i_ino, inode->i_ino);
>  
>  	mutex_lock(&sbi->vh_mutex);
> @@ -385,7 +385,7 @@ static int hfsplus_unlink(struct inode *dir, struct dentry *dentry)
>  	if (HFSPLUS_IS_RSRC(inode))
>  		return -EPERM;
>  
> -	hfs_dbg("dir->i_ino %lu, inode->i_ino %lu\n",
> +	hfs_dbg("dir->i_ino %" PRIino "u, inode->i_ino %" PRIino "u\n",
>  		dir->i_ino, inode->i_ino);
>  
>  	mutex_lock(&sbi->vh_mutex);
> @@ -393,7 +393,7 @@ static int hfsplus_unlink(struct inode *dir, struct dentry *dentry)
>  	if (inode->i_ino == cnid &&
>  	    atomic_read(&HFSPLUS_I(inode)->opencnt)) {
>  		str.name = name;
> -		str.len = sprintf(name, "temp%lu", inode->i_ino);
> +		str.len = sprintf(name, "temp%" PRIino "u", inode->i_ino);
>  		res = hfsplus_rename_cat(inode->i_ino,
>  					 dir, &dentry->d_name,
>  					 sbi->hidden_dir, &str);
> diff --git a/fs/hfsplus/extents.c b/fs/hfsplus/extents.c
> index 8e886514d27f1e5d4d94be75142f197669e62234..1dbfdf44f954f2768852678d1e386a91758848f9 100644
> --- a/fs/hfsplus/extents.c
> +++ b/fs/hfsplus/extents.c
> @@ -275,7 +275,7 @@ int hfsplus_get_block(struct inode *inode, sector_t iblock,
>  	mutex_unlock(&hip->extents_lock);
>  
>  done:
> -	hfs_dbg("ino %lu, iblock %llu - dblock %u\n",
> +	hfs_dbg("ino %" PRIino "u, iblock %llu - dblock %u\n",
>  		inode->i_ino, (long long)iblock, dblock);
>  
>  	mask = (1 << sbi->fs_shift) - 1;
> @@ -476,7 +476,7 @@ int hfsplus_file_extend(struct inode *inode, bool zeroout)
>  			goto out;
>  	}
>  
> -	hfs_dbg("ino %lu, start %u, len %u\n", inode->i_ino, start, len);
> +	hfs_dbg("ino %" PRIino "u, start %u, len %u\n", inode->i_ino, start, len);
>  
>  	if (hip->alloc_blocks <= hip->first_blocks) {
>  		if (!hip->first_blocks) {
> @@ -545,7 +545,7 @@ void hfsplus_file_truncate(struct inode *inode)
>  	u32 alloc_cnt, blk_cnt, start;
>  	int res;
>  
> -	hfs_dbg("ino %lu, phys_size %llu -> i_size %llu\n",
> +	hfs_dbg("ino %" PRIino "u, phys_size %llu -> i_size %llu\n",
>  		inode->i_ino, (long long)hip->phys_size, inode->i_size);
>  
>  	if (inode->i_size > hip->phys_size) {
> diff --git a/fs/hfsplus/inode.c b/fs/hfsplus/inode.c
> index 922ff41df042a83d47364f2d941c45dabda29afb..f61397db976e8b15fa186c3b31af71e55f9e26a6 100644
> --- a/fs/hfsplus/inode.c
> +++ b/fs/hfsplus/inode.c
> @@ -230,7 +230,7 @@ static int hfsplus_get_perms(struct inode *inode,
>  		inode->i_flags &= ~S_APPEND;
>  	return 0;
>  bad_type:
> -	pr_err("invalid file type 0%04o for inode %lu\n", mode, inode->i_ino);
> +	pr_err("invalid file type 0%04o for inode %" PRIino "u\n", mode, inode->i_ino);
>  	return -EIO;
>  }
>  
> @@ -328,7 +328,7 @@ int hfsplus_file_fsync(struct file *file, loff_t start, loff_t end,
>  	struct hfsplus_vh *vhdr = sbi->s_vhdr;
>  	int error = 0, error2;
>  
> -	hfs_dbg("inode->i_ino %lu, start %llu, end %llu\n",
> +	hfs_dbg("inode->i_ino %" PRIino "u, start %llu, end %llu\n",
>  		inode->i_ino, start, end);
>  
>  	error = file_write_and_wait_range(file, start, end);
> @@ -639,7 +639,7 @@ int hfsplus_cat_write_inode(struct inode *inode)
>  	hfsplus_cat_entry entry;
>  	int res = 0;
>  
> -	hfs_dbg("inode->i_ino %lu\n", inode->i_ino);
> +	hfs_dbg("inode->i_ino %" PRIino "u\n", inode->i_ino);
>  
>  	if (HFSPLUS_IS_RSRC(inode))
>  		main_inode = HFSPLUS_I(inode)->rsrc_inode;
> @@ -716,7 +716,7 @@ int hfsplus_cat_write_inode(struct inode *inode)
>  	if (!res) {
>  		res = hfs_btree_write(tree);
>  		if (res) {
> -			pr_err("b-tree write err: %d, ino %lu\n",
> +			pr_err("b-tree write err: %d, ino %" PRIino "u\n",
>  			       res, inode->i_ino);
>  		}
>  	}
> diff --git a/fs/hfsplus/super.c b/fs/hfsplus/super.c
> index 7229a8ae89f9469109b1c3a317ee9b7705a83f8b..b76865e2eac5260b681fc46b297f1665f1bc10da 100644
> --- a/fs/hfsplus/super.c
> +++ b/fs/hfsplus/super.c
> @@ -156,7 +156,7 @@ static int hfsplus_system_write_inode(struct inode *inode)
>  		int err = hfs_btree_write(tree);
>  
>  		if (err) {
> -			pr_err("b-tree write err: %d, ino %lu\n",
> +			pr_err("b-tree write err: %d, ino %" PRIino "u\n",
>  			       err, inode->i_ino);
>  			return err;
>  		}
> @@ -169,7 +169,7 @@ static int hfsplus_write_inode(struct inode *inode,
>  {
>  	int err;
>  
> -	hfs_dbg("ino %lu\n", inode->i_ino);
> +	hfs_dbg("ino %" PRIino "u\n", inode->i_ino);
>  
>  	err = hfsplus_ext_write_extent(inode);
>  	if (err)
> @@ -184,7 +184,7 @@ static int hfsplus_write_inode(struct inode *inode,
>  
>  static void hfsplus_evict_inode(struct inode *inode)
>  {
> -	hfs_dbg("ino %lu\n", inode->i_ino);
> +	hfs_dbg("ino %" PRIino "u\n", inode->i_ino);
>  	truncate_inode_pages_final(&inode->i_data);
>  	clear_inode(inode);
>  	if (HFSPLUS_IS_RSRC(inode)) {
> diff --git a/fs/hfsplus/xattr.c b/fs/hfsplus/xattr.c
> index 9904944cbd54e3d326591fa65a5ed678f38ca583..ef9121843482e81961fa541c53c906ab04d6fc33 100644
> --- a/fs/hfsplus/xattr.c
> +++ b/fs/hfsplus/xattr.c
> @@ -277,7 +277,7 @@ int __hfsplus_setxattr(struct inode *inode, const char *name,
>  	u16 folder_finderinfo_len = sizeof(DInfo) + sizeof(DXInfo);
>  	u16 file_finderinfo_len = sizeof(FInfo) + sizeof(FXInfo);
>  
> -	hfs_dbg("ino %lu, name %s, value %p, size %zu\n",
> +	hfs_dbg("ino %" PRIino "u, name %s, value %p, size %zu\n",
>  		inode->i_ino, name ? name : NULL,
>  		value, size);
>  
> @@ -447,7 +447,7 @@ int hfsplus_setxattr(struct inode *inode, const char *name,
>  		NLS_MAX_CHARSET_SIZE * HFSPLUS_ATTR_MAX_STRLEN + 1;
>  	int res;
>  
> -	hfs_dbg("ino %lu, name %s, prefix %s, prefixlen %zu, "
> +	hfs_dbg("ino %" PRIino "u, name %s, prefix %s, prefixlen %zu, "
>  		"value %p, size %zu\n",
>  		inode->i_ino, name ? name : NULL,
>  		prefix ? prefix : NULL, prefixlen,
> @@ -607,7 +607,7 @@ ssize_t hfsplus_getxattr(struct inode *inode, const char *name,
>  	int res;
>  	char *xattr_name;
>  
> -	hfs_dbg("ino %lu, name %s, prefix %s\n",
> +	hfs_dbg("ino %" PRIino "u, name %s, prefix %s\n",
>  		inode->i_ino, name ? name : NULL,
>  		prefix ? prefix : NULL);
>  
> @@ -717,7 +717,7 @@ ssize_t hfsplus_listxattr(struct dentry *dentry, char *buffer, size_t size)
>  	size_t strbuf_size;
>  	int xattr_name_len;
>  
> -	hfs_dbg("ino %lu\n", inode->i_ino);
> +	hfs_dbg("ino %" PRIino "u\n", inode->i_ino);
>  
>  	if (!is_xattr_operation_supported(inode))
>  		return -EOPNOTSUPP;
> @@ -819,7 +819,7 @@ static int hfsplus_removexattr(struct inode *inode, const char *name)
>  	int is_xattr_acl_deleted;
>  	int is_all_xattrs_deleted;
>  
> -	hfs_dbg("ino %lu, name %s\n",
> +	hfs_dbg("ino %" PRIino "u, name %s\n",
>  		inode->i_ino, name ? name : NULL);
>  
>  	if (!HFSPLUS_SB(inode->i_sb)->attr_tree)

Reviewed-by: Viacheslav Dubeyko <slava@dubeyko.com>

Thanks,
Slava.

^ permalink raw reply

* Re:  [PATCH v2 015/110] nilfs2: use PRIino format for i_ino
From: Viacheslav Dubeyko @ 2026-03-02 22:34 UTC (permalink / raw)
  To: socketcan@hartkopp.net, herbert@gondor.apana.org.au,
	jolsa@kernel.org, jreuter@yaina.de, Dai.Ngo@oracle.com,
	Ondrej Mosnacek, davem@davemloft.net, dlemoal@kernel.org,
	trondmy@kernel.org, namhyung@kernel.org,
	almaz.alexandrovich@paragon-software.com, miklos@szeredi.hu,
	john.johansen@canonical.com, stephen.smalley.work@gmail.com,
	nico@fluxnic.net, maciej.fijalkowski@intel.com, Olga Kornievskaia,
	amir73il@gmail.com, tom@talpey.com, joseph.qi@linux.alibaba.com,
	paul@paul-moore.com, asmadeus@codewreck.org,
	alexander.shishkin@linux.intel.com, mark@fasheh.com,
	linux_oss@crudebyte.com, alexander.deucher@amd.com,
	viro@zeniv.linux.org.uk, willy@infradead.org, ebiggers@kernel.org,
	lucien.xin@gmail.com, bharathsm@microsoft.com,
	marcel@holtmann.org, sumit.semwal@linaro.org, Eric Paris,
	djwong@kernel.org, simona@ffwll.ch, hawk@kernel.org,
	mark.rutland@arm.com, james.clark@linaro.org,
	john.fastabend@gmail.com, dsterba@suse.com, kuniyu@google.com,
	hch@infradead.org, luiz.dentz@gmail.com, daniel@iogearbox.net,
	dwmw2@infradead.org, ncardwell@google.com, sprasad@microsoft.com,
	marcelo.leitner@gmail.com, edumazet@google.com,
	rostedt@goodmis.org, jack@suse.com, mhiramat@kernel.org,
	frank.li@vivo.com, alex.aring@gmail.com, luisbg@kernel.org,
	ms@dev.tdt.de, jth@kernel.org, jlbec@evilplan.org,
	aivazian.tigran@gmail.com, anna@kernel.org, peterz@infradead.org,
	tytso@mit.edu, willemb@google.com, eric.snowberg@oracle.com,
	johan.hedberg@gmail.com, acme@kernel.org,
	ronniesahlberg@gmail.com, jaharkes@cs.cmu.edu, David Howells,
	jaegeuk@kernel.org, courmisch@gmail.com, martin@omnibond.com,
	christian.koenig@amd.com, jmorris@namei.org,
	adilger.kernel@dilger.ca, idryomov@gmail.com, brauner@kernel.org,
	Paolo Abeni, glaubitz@physik.fu-berlin.de,
	magnus.karlsson@intel.com, airlied@gmail.com, coda@cs.cmu.edu,
	casey@schaufler-ca.com, raven@themaw.net, horms@kernel.org,
	adrian.hunter@intel.com, kuba@kernel.org, muchun.song@linux.dev,
	chao@kernel.org, mathieu.desnoyers@efficios.com,
	hubcap@omnibond.com, jlayton@kernel.org, sdf@fomichev.me,
	roberto.sassu@huawei.com, Alex Markuze, chengzhihao1@huawei.com,
	mikulas@artax.karlin.mff.cuni.cz, ericvh@kernel.org,
	salah.triki@gmail.com, osalvador@suse.de,
	dmitry.kasatkin@gmail.com, sfrench@samba.org, serge@hallyn.com,
	wufan@kernel.org, al@alarsen.net, pc@manguebit.org,
	ast@kernel.org, oleg@redhat.com, slava@dubeyko.com,
	konishi.ryusuke@gmail.com, lucho@ionkov.net, dsahern@kernel.org,
	shaggy@kernel.org, richard@nod.at, marc.dionne@auristor.com,
	neil@brown.name, dan.j.williams@intel.com, mkl@pengutronix.de,
	david@kernel.org, Ingo Molnar, jack@suse.cz, code@tyhicks.com,
	steffen.klassert@secunet.com, naohiro.aota@wdc.com,
	zohar@linux.ibm.com, chuck.lever@oracle.com, irogers@google.com
  Cc: linux-sctp@vger.kernel.org, ecryptfs@vger.kernel.org,
	linux-unionfs@vger.kernel.org, apparmor@lists.ubuntu.com,
	linux-ext4@vger.kernel.org, autofs@vger.kernel.org,
	amd-gfx@lists.freedesktop.org, fsverity@lists.linux.dev,
	ntfs3@lists.linux.dev, ocfs2-devel@lists.linux.dev,
	linux-fsdevel@vger.kernel.org, linux-media@vger.kernel.org,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
	linux-integrity@vger.kernel.org, samba-technical@lists.samba.org,
	linux-nilfs@vger.kernel.org, audit@vger.kernel.org,
	selinux@vger.kernel.org, linaro-mm-sig@lists.linaro.org,
	linux-trace-kernel@vger.kernel.org, v9fs@lists.linux.dev,
	linux-xfs@vger.kernel.org, linux-x25@vger.kernel.org,
	linux-f2fs-devel@lists.sourceforge.net,
	linux-bluetooth@vger.kernel.org, nvdimm@lists.linux.dev,
	ceph-devel@vger.kernel.org, jfs-discussion@lists.sourceforge.net,
	linux-mtd@lists.infradead.org, devel@lists.orangefs.org,
	linux-afs@lists.infradead.org, linux-fscrypt@vger.kernel.org,
	linux-security-module@vger.kernel.org, linux-cifs@vger.kernel.org,
	linux-hams@vger.kernel.org, bpf@vger.kernel.org,
	linux-can@vger.kernel.org, linux-nfs@vger.kernel.org,
	codalist@coda.cs.cmu.edu, linux-mm@kvack.org,
	netfs@lists.linux.dev, linux-perf-users@vger.kernel.org,
	dri-devel@lists.freedesktop.org
In-Reply-To: <20260302-iino-u64-v2-15-e5388800dae0@kernel.org>

On Mon, 2026-03-02 at 15:23 -0500, Jeff Layton wrote:
> Convert nilfs2 i_ino format strings to use the PRIino format
> macro in preparation for the widening of i_ino via kino_t.
> 
> In trace events, change __field(ino_t, ...) to __field(u64, ...)
> and update TP_printk format strings to %llu/%llx to match the
> widened field type.
> 
> Signed-off-by: Jeff Layton <jlayton@kernel.org>
> ---
>  fs/nilfs2/alloc.c             | 10 +++++-----
>  fs/nilfs2/bmap.c              |  2 +-
>  fs/nilfs2/btnode.c            |  2 +-
>  fs/nilfs2/btree.c             | 12 ++++++------
>  fs/nilfs2/dir.c               | 12 ++++++------
>  fs/nilfs2/direct.c            |  4 ++--
>  fs/nilfs2/gcinode.c           |  2 +-
>  fs/nilfs2/inode.c             |  8 ++++----
>  fs/nilfs2/mdt.c               |  2 +-
>  fs/nilfs2/namei.c             |  2 +-
>  fs/nilfs2/segment.c           |  2 +-
>  include/trace/events/nilfs2.h | 12 ++++++------
>  12 files changed, 35 insertions(+), 35 deletions(-)
> 
> diff --git a/fs/nilfs2/alloc.c b/fs/nilfs2/alloc.c
> index e7eebb04f9a4080a39f17d4123e58ed7df6b2f4b..a3c559c86e5a4c63b1c9dd4ca137f24749c3ee87 100644
> --- a/fs/nilfs2/alloc.c
> +++ b/fs/nilfs2/alloc.c
> @@ -707,7 +707,7 @@ void nilfs_palloc_commit_free_entry(struct inode *inode,
>  
>  	if (!nilfs_clear_bit_atomic(lock, group_offset, bitmap))
>  		nilfs_warn(inode->i_sb,
> -			   "%s (ino=%lu): entry number %llu already freed",
> +			   "%s (ino=%" PRIino "u): entry number %llu already freed",
>  			   __func__, inode->i_ino,
>  			   (unsigned long long)req->pr_entry_nr);
>  	else
> @@ -748,7 +748,7 @@ void nilfs_palloc_abort_alloc_entry(struct inode *inode,
>  
>  	if (!nilfs_clear_bit_atomic(lock, group_offset, bitmap))
>  		nilfs_warn(inode->i_sb,
> -			   "%s (ino=%lu): entry number %llu already freed",
> +			   "%s (ino=%" PRIino "u): entry number %llu already freed",
>  			   __func__, inode->i_ino,
>  			   (unsigned long long)req->pr_entry_nr);
>  	else
> @@ -861,7 +861,7 @@ int nilfs_palloc_freev(struct inode *inode, __u64 *entry_nrs, size_t nitems)
>  			if (!nilfs_clear_bit_atomic(lock, group_offset,
>  						    bitmap)) {
>  				nilfs_warn(inode->i_sb,
> -					   "%s (ino=%lu): entry number %llu already freed",
> +					   "%s (ino=%" PRIino "u): entry number %llu already freed",
>  					   __func__, inode->i_ino,
>  					   (unsigned long long)entry_nrs[j]);
>  			} else {
> @@ -906,7 +906,7 @@ int nilfs_palloc_freev(struct inode *inode, __u64 *entry_nrs, size_t nitems)
>  							      last_nrs[k]);
>  			if (ret && ret != -ENOENT)
>  				nilfs_warn(inode->i_sb,
> -					   "error %d deleting block that object (entry=%llu, ino=%lu) belongs to",
> +					   "error %d deleting block that object (entry=%llu, ino=%" PRIino "u) belongs to",
>  					   ret, (unsigned long long)last_nrs[k],
>  					   inode->i_ino);
>  		}
> @@ -923,7 +923,7 @@ int nilfs_palloc_freev(struct inode *inode, __u64 *entry_nrs, size_t nitems)
>  			ret = nilfs_palloc_delete_bitmap_block(inode, group);
>  			if (ret && ret != -ENOENT)
>  				nilfs_warn(inode->i_sb,
> -					   "error %d deleting bitmap block of group=%lu, ino=%lu",
> +					   "error %d deleting bitmap block of group=%lu, ino=%" PRIino "u",
>  					   ret, group, inode->i_ino);
>  		}
>  	}
> diff --git a/fs/nilfs2/bmap.c b/fs/nilfs2/bmap.c
> index ccc1a7aa52d2064d56b826058554264c498d592f..e12979bac3c3ee5eb7fcc2bf156fe6e48fc65a7d 100644
> --- a/fs/nilfs2/bmap.c
> +++ b/fs/nilfs2/bmap.c
> @@ -33,7 +33,7 @@ static int nilfs_bmap_convert_error(struct nilfs_bmap *bmap,
>  
>  	if (err == -EINVAL) {
>  		__nilfs_error(inode->i_sb, fname,
> -			      "broken bmap (inode number=%lu)", inode->i_ino);
> +			      "broken bmap (inode number=%" PRIino "u)", inode->i_ino);
>  		err = -EIO;
>  	}
>  	return err;
> diff --git a/fs/nilfs2/btnode.c b/fs/nilfs2/btnode.c
> index 56836712909201775907483887e8a0022851bbec..3d64f3a9223e5601dc2332ae6e1007edd5b4827b 100644
> --- a/fs/nilfs2/btnode.c
> +++ b/fs/nilfs2/btnode.c
> @@ -64,7 +64,7 @@ nilfs_btnode_create_block(struct address_space *btnc, __u64 blocknr)
>  		 * clearing of an abandoned b-tree node is missing somewhere).
>  		 */
>  		nilfs_error(inode->i_sb,
> -			    "state inconsistency probably due to duplicate use of b-tree node block address %llu (ino=%lu)",
> +			    "state inconsistency probably due to duplicate use of b-tree node block address %llu (ino=%" PRIino "u)",
>  			    (unsigned long long)blocknr, inode->i_ino);
>  		goto failed;
>  	}
> diff --git a/fs/nilfs2/btree.c b/fs/nilfs2/btree.c
> index dd0c8e560ef6a2c96515025321914e0d73f41144..57163e991fbc49e2bfba2fa543f1b8dbd77718f4 100644
> --- a/fs/nilfs2/btree.c
> +++ b/fs/nilfs2/btree.c
> @@ -353,7 +353,7 @@ static int nilfs_btree_node_broken(const struct nilfs_btree_node *node,
>  		     nchildren <= 0 ||
>  		     nchildren > NILFS_BTREE_NODE_NCHILDREN_MAX(size))) {
>  		nilfs_crit(inode->i_sb,
> -			   "bad btree node (ino=%lu, blocknr=%llu): level = %d, flags = 0x%x, nchildren = %d",
> +			   "bad btree node (ino=%" PRIino "u, blocknr=%llu): level = %d, flags = 0x%x, nchildren = %d",
>  			   inode->i_ino, (unsigned long long)blocknr, level,
>  			   flags, nchildren);
>  		ret = 1;
> @@ -384,7 +384,7 @@ static int nilfs_btree_root_broken(const struct nilfs_btree_node *node,
>  		     nchildren > NILFS_BTREE_ROOT_NCHILDREN_MAX ||
>  		     (nchildren == 0 && level > NILFS_BTREE_LEVEL_NODE_MIN))) {
>  		nilfs_crit(inode->i_sb,
> -			   "bad btree root (ino=%lu): level = %d, flags = 0x%x, nchildren = %d",
> +			   "bad btree root (ino=%" PRIino "u): level = %d, flags = 0x%x, nchildren = %d",
>  			   inode->i_ino, level, flags, nchildren);
>  		ret = 1;
>  	}
> @@ -453,7 +453,7 @@ static int nilfs_btree_bad_node(const struct nilfs_bmap *btree,
>  	if (unlikely(nilfs_btree_node_get_level(node) != level)) {
>  		dump_stack();
>  		nilfs_crit(btree->b_inode->i_sb,
> -			   "btree level mismatch (ino=%lu): %d != %d",
> +			   "btree level mismatch (ino=%" PRIino "u): %d != %d",
>  			   btree->b_inode->i_ino,
>  			   nilfs_btree_node_get_level(node), level);
>  		return 1;
> @@ -521,7 +521,7 @@ static int __nilfs_btree_get_block(const struct nilfs_bmap *btree, __u64 ptr,
>   out_no_wait:
>  	if (!buffer_uptodate(bh)) {
>  		nilfs_err(btree->b_inode->i_sb,
> -			  "I/O error reading b-tree node block (ino=%lu, blocknr=%llu)",
> +			  "I/O error reading b-tree node block (ino=%" PRIino "u, blocknr=%llu)",
>  			  btree->b_inode->i_ino, (unsigned long long)ptr);
>  		brelse(bh);
>  		return -EIO;
> @@ -2104,7 +2104,7 @@ static int nilfs_btree_propagate(struct nilfs_bmap *btree,
>  	if (ret < 0) {
>  		if (unlikely(ret == -ENOENT)) {
>  			nilfs_crit(btree->b_inode->i_sb,
> -				   "writing node/leaf block does not appear in b-tree (ino=%lu) at key=%llu, level=%d",
> +				   "writing node/leaf block does not appear in b-tree (ino=%" PRIino "u) at key=%llu, level=%d",
>  				   btree->b_inode->i_ino,
>  				   (unsigned long long)key, level);
>  			ret = -EINVAL;
> @@ -2146,7 +2146,7 @@ static void nilfs_btree_add_dirty_buffer(struct nilfs_bmap *btree,
>  	    level >= NILFS_BTREE_LEVEL_MAX) {
>  		dump_stack();
>  		nilfs_warn(btree->b_inode->i_sb,
> -			   "invalid btree level: %d (key=%llu, ino=%lu, blocknr=%llu)",
> +			   "invalid btree level: %d (key=%llu, ino=%" PRIino "u, blocknr=%llu)",
>  			   level, (unsigned long long)key,
>  			   btree->b_inode->i_ino,
>  			   (unsigned long long)bh->b_blocknr);
> diff --git a/fs/nilfs2/dir.c b/fs/nilfs2/dir.c
> index b243199036dfa1ab2299efaaa5bdf5da2d159ff2..b182da076c58c4813145bc3e501a1e9a188bce85 100644
> --- a/fs/nilfs2/dir.c
> +++ b/fs/nilfs2/dir.c
> @@ -150,7 +150,7 @@ static bool nilfs_check_folio(struct folio *folio, char *kaddr)
>  
>  Ebadsize:
>  	nilfs_error(sb,
> -		    "size of directory #%lu is not a multiple of chunk size",
> +		    "size of directory #%" PRIino "u is not a multiple of chunk size",
>  		    dir->i_ino);
>  	goto fail;
>  Eshort:
> @@ -169,7 +169,7 @@ static bool nilfs_check_folio(struct folio *folio, char *kaddr)
>  	error = "disallowed inode number";
>  bad_entry:
>  	nilfs_error(sb,
> -		    "bad entry in directory #%lu: %s - offset=%lu, inode=%lu, rec_len=%zd, name_len=%d",
> +		    "bad entry in directory #%" PRIino "u: %s - offset=%lu, inode=%lu, rec_len=%zd, name_len=%d",
>  		    dir->i_ino, error, (folio->index << PAGE_SHIFT) + offs,
>  		    (unsigned long)le64_to_cpu(p->inode),
>  		    rec_len, p->name_len);
> @@ -177,7 +177,7 @@ static bool nilfs_check_folio(struct folio *folio, char *kaddr)
>  Eend:
>  	p = (struct nilfs_dir_entry *)(kaddr + offs);
>  	nilfs_error(sb,
> -		    "entry in directory #%lu spans the page boundary offset=%lu, inode=%lu",
> +		    "entry in directory #%" PRIino "u spans the page boundary offset=%lu, inode=%lu",
>  		    dir->i_ino, (folio->index << PAGE_SHIFT) + offs,
>  		    (unsigned long)le64_to_cpu(p->inode));
>  fail:
> @@ -251,7 +251,7 @@ static int nilfs_readdir(struct file *file, struct dir_context *ctx)
>  
>  		kaddr = nilfs_get_folio(inode, n, &folio);
>  		if (IS_ERR(kaddr)) {
> -			nilfs_error(sb, "bad page in #%lu", inode->i_ino);
> +			nilfs_error(sb, "bad page in #%" PRIino "u", inode->i_ino);
>  			ctx->pos += PAGE_SIZE - offset;
>  			return -EIO;
>  		}
> @@ -336,7 +336,7 @@ struct nilfs_dir_entry *nilfs_find_entry(struct inode *dir,
>  		/* next folio is past the blocks we've got */
>  		if (unlikely(n > (dir->i_blocks >> (PAGE_SHIFT - 9)))) {
>  			nilfs_error(dir->i_sb,
> -			       "dir %lu size %lld exceeds block count %llu",
> +			       "dir %" PRIino "u size %lld exceeds block count %llu",
>  			       dir->i_ino, dir->i_size,
>  			       (unsigned long long)dir->i_blocks);
>  			goto out;
> @@ -382,7 +382,7 @@ struct nilfs_dir_entry *nilfs_dotdot(struct inode *dir, struct folio **foliop)
>  	return next_de;
>  
>  fail:
> -	nilfs_error(dir->i_sb, "directory #%lu %s", dir->i_ino, msg);
> +	nilfs_error(dir->i_sb, "directory #%" PRIino "u %s", dir->i_ino, msg);
>  	folio_release_kmap(folio, de);
>  	return NULL;
>  }
> diff --git a/fs/nilfs2/direct.c b/fs/nilfs2/direct.c
> index 2d8dc6b35b5477947ca12a70288d3a3cce858aab..1084d4d586e078ab6825167976dd2a71d52bc8aa 100644
> --- a/fs/nilfs2/direct.c
> +++ b/fs/nilfs2/direct.c
> @@ -338,7 +338,7 @@ static int nilfs_direct_assign(struct nilfs_bmap *bmap,
>  	key = nilfs_bmap_data_get_key(bmap, *bh);
>  	if (unlikely(key > NILFS_DIRECT_KEY_MAX)) {
>  		nilfs_crit(bmap->b_inode->i_sb,
> -			   "%s (ino=%lu): invalid key: %llu",
> +			   "%s (ino=%" PRIino "u): invalid key: %llu",
>  			   __func__,
>  			   bmap->b_inode->i_ino, (unsigned long long)key);
>  		return -EINVAL;
> @@ -346,7 +346,7 @@ static int nilfs_direct_assign(struct nilfs_bmap *bmap,
>  	ptr = nilfs_direct_get_ptr(bmap, key);
>  	if (unlikely(ptr == NILFS_BMAP_INVALID_PTR)) {
>  		nilfs_crit(bmap->b_inode->i_sb,
> -			   "%s (ino=%lu): invalid pointer: %llu",
> +			   "%s (ino=%" PRIino "u): invalid pointer: %llu",
>  			   __func__,
>  			   bmap->b_inode->i_ino, (unsigned long long)ptr);
>  		return -EINVAL;
> diff --git a/fs/nilfs2/gcinode.c b/fs/nilfs2/gcinode.c
> index 561c220799c7aee879ad866865e377799c8ee6bb..714962d010da4a23e9b5f40de8aaaca8b95a74da 100644
> --- a/fs/nilfs2/gcinode.c
> +++ b/fs/nilfs2/gcinode.c
> @@ -137,7 +137,7 @@ int nilfs_gccache_wait_and_mark_dirty(struct buffer_head *bh)
>  		struct inode *inode = bh->b_folio->mapping->host;
>  
>  		nilfs_err(inode->i_sb,
> -			  "I/O error reading %s block for GC (ino=%lu, vblocknr=%llu)",
> +			  "I/O error reading %s block for GC (ino=%" PRIino "u, vblocknr=%llu)",
>  			  buffer_nilfs_node(bh) ? "node" : "data",
>  			  inode->i_ino, (unsigned long long)bh->b_blocknr);
>  		return -EIO;
> diff --git a/fs/nilfs2/inode.c b/fs/nilfs2/inode.c
> index 51bde45d586509dda3ef0cb7c46facb7fb2c61dd..0bc1c5141ec596b3c31e7d18e4ba3541bf618406 100644
> --- a/fs/nilfs2/inode.c
> +++ b/fs/nilfs2/inode.c
> @@ -108,7 +108,7 @@ int nilfs_get_block(struct inode *inode, sector_t blkoff,
>  				 * be locked in this case.
>  				 */
>  				nilfs_warn(inode->i_sb,
> -					   "%s (ino=%lu): a race condition while inserting a data block at offset=%llu",
> +					   "%s (ino=%" PRIino "u): a race condition while inserting a data block at offset=%llu",
>  					   __func__, inode->i_ino,
>  					   (unsigned long long)blkoff);
>  				err = -EAGAIN;
> @@ -789,7 +789,7 @@ static void nilfs_truncate_bmap(struct nilfs_inode_info *ii,
>  		goto repeat;
>  
>  failed:
> -	nilfs_warn(ii->vfs_inode.i_sb, "error %d truncating bmap (ino=%lu)",
> +	nilfs_warn(ii->vfs_inode.i_sb, "error %d truncating bmap (ino=%" PRIino "u)",
>  		   ret, ii->vfs_inode.i_ino);
>  }
>  
> @@ -1026,7 +1026,7 @@ int nilfs_set_file_dirty(struct inode *inode, unsigned int nr_dirty)
>  			 * this inode.
>  			 */
>  			nilfs_warn(inode->i_sb,
> -				   "cannot set file dirty (ino=%lu): the file is being freed",
> +				   "cannot set file dirty (ino=%" PRIino "u): the file is being freed",
>  				   inode->i_ino);
>  			spin_unlock(&nilfs->ns_inode_lock);
>  			return -EINVAL; /*
> @@ -1057,7 +1057,7 @@ int __nilfs_mark_inode_dirty(struct inode *inode, int flags)
>  	err = nilfs_load_inode_block(inode, &ibh);
>  	if (unlikely(err)) {
>  		nilfs_warn(inode->i_sb,
> -			   "cannot mark inode dirty (ino=%lu): error %d loading inode block",
> +			   "cannot mark inode dirty (ino=%" PRIino "u): error %d loading inode block",
>  			   inode->i_ino, err);
>  		return err;
>  	}
> diff --git a/fs/nilfs2/mdt.c b/fs/nilfs2/mdt.c
> index 946b0d3534a5f22f34ac44a91fb121541881c548..8629c72b62db33217d4747124885b6f727f182be 100644
> --- a/fs/nilfs2/mdt.c
> +++ b/fs/nilfs2/mdt.c
> @@ -203,7 +203,7 @@ static int nilfs_mdt_read_block(struct inode *inode, unsigned long block,
>  	err = -EIO;
>  	if (!buffer_uptodate(first_bh)) {
>  		nilfs_err(inode->i_sb,
> -			  "I/O error reading meta-data file (ino=%lu, block-offset=%lu)",
> +			  "I/O error reading meta-data file (ino=%" PRIino "u, block-offset=%lu)",
>  			  inode->i_ino, block);
>  		goto failed_bh;
>  	}
> diff --git a/fs/nilfs2/namei.c b/fs/nilfs2/namei.c
> index 40f4b1a28705b6e0eb8f0978cf3ac18b43aa1331..29edb84a0663caa4b29fa488c0495fc53358ca00 100644
> --- a/fs/nilfs2/namei.c
> +++ b/fs/nilfs2/namei.c
> @@ -292,7 +292,7 @@ static int nilfs_do_unlink(struct inode *dir, struct dentry *dentry)
>  
>  	if (!inode->i_nlink) {
>  		nilfs_warn(inode->i_sb,
> -			   "deleting nonexistent file (ino=%lu), %d",
> +			   "deleting nonexistent file (ino=%" PRIino "u), %d",
>  			   inode->i_ino, inode->i_nlink);
>  		set_nlink(inode, 1);
>  	}
> diff --git a/fs/nilfs2/segment.c b/fs/nilfs2/segment.c
> index 098a3bd103e04cd09b0689fe2017380d74664496..9a8bc3fa35ce9b447abbc2fb56cbd2b0cc5f76de 100644
> --- a/fs/nilfs2/segment.c
> +++ b/fs/nilfs2/segment.c
> @@ -2024,7 +2024,7 @@ static int nilfs_segctor_collect_dirty_files(struct nilfs_sc_info *sci,
>  				ifile, ii->vfs_inode.i_ino, &ibh);
>  			if (unlikely(err)) {
>  				nilfs_warn(sci->sc_super,
> -					   "log writer: error %d getting inode block (ino=%lu)",
> +					   "log writer: error %d getting inode block (ino=%" PRIino "u)",
>  					   err, ii->vfs_inode.i_ino);
>  				return err;
>  			}
> diff --git a/include/trace/events/nilfs2.h b/include/trace/events/nilfs2.h
> index 8880c11733dd307c223cc62ee34ebeff650ecb12..86a0011c9eeaf031cfa0b79875b2b106ef8b7cfd 100644
> --- a/include/trace/events/nilfs2.h
> +++ b/include/trace/events/nilfs2.h
> @@ -165,14 +165,14 @@ TRACE_EVENT(nilfs2_segment_usage_freed,
>  
>  TRACE_EVENT(nilfs2_mdt_insert_new_block,
>  	    TP_PROTO(struct inode *inode,
> -		     unsigned long ino,
> +		     u64 ino,
>  		     unsigned long block),
>  
>  	    TP_ARGS(inode, ino, block),
>  
>  	    TP_STRUCT__entry(
>  		    __field(struct inode *, inode)
> -		    __field(unsigned long, ino)
> +		    __field(u64, ino)
>  		    __field(unsigned long, block)
>  	    ),
>  
> @@ -182,7 +182,7 @@ TRACE_EVENT(nilfs2_mdt_insert_new_block,
>  		    __entry->block = block;
>  		    ),
>  
> -	    TP_printk("inode = %p ino = %lu block = %lu",
> +	    TP_printk("inode = %p ino = %llu block = %lu",
>  		      __entry->inode,
>  		      __entry->ino,
>  		      __entry->block)
> @@ -190,7 +190,7 @@ TRACE_EVENT(nilfs2_mdt_insert_new_block,
>  
>  TRACE_EVENT(nilfs2_mdt_submit_block,
>  	    TP_PROTO(struct inode *inode,
> -		     unsigned long ino,
> +		     u64 ino,
>  		     unsigned long blkoff,
>  		     enum req_op mode),
>  
> @@ -198,7 +198,7 @@ TRACE_EVENT(nilfs2_mdt_submit_block,
>  
>  	    TP_STRUCT__entry(
>  		    __field(struct inode *, inode)
> -		    __field(unsigned long, ino)
> +		    __field(u64, ino)
>  		    __field(unsigned long, blkoff)
>  		    /*
>  		     * Use field_struct() to avoid is_signed_type() on the
> @@ -214,7 +214,7 @@ TRACE_EVENT(nilfs2_mdt_submit_block,
>  		    __entry->mode = mode;
>  		    ),
>  
> -	    TP_printk("inode = %p ino = %lu blkoff = %lu mode = %x",
> +	    TP_printk("inode = %p ino = %llu blkoff = %lu mode = %x",
>  		      __entry->inode,
>  		      __entry->ino,
>  		      __entry->blkoff,

Reviewed-by: Viacheslav Dubeyko <slava@dubeyko.com>

Thanks,
Slava.

^ permalink raw reply

* Re:  [PATCH v2 031/110] hfs: use PRIino format for i_ino
From: Viacheslav Dubeyko @ 2026-03-02 22:26 UTC (permalink / raw)
  To: socketcan@hartkopp.net, herbert@gondor.apana.org.au,
	jolsa@kernel.org, jreuter@yaina.de, Dai.Ngo@oracle.com,
	Ondrej Mosnacek, davem@davemloft.net, dlemoal@kernel.org,
	trondmy@kernel.org, namhyung@kernel.org,
	almaz.alexandrovich@paragon-software.com, miklos@szeredi.hu,
	john.johansen@canonical.com, stephen.smalley.work@gmail.com,
	nico@fluxnic.net, maciej.fijalkowski@intel.com, Olga Kornievskaia,
	amir73il@gmail.com, tom@talpey.com, joseph.qi@linux.alibaba.com,
	paul@paul-moore.com, asmadeus@codewreck.org,
	alexander.shishkin@linux.intel.com, mark@fasheh.com,
	linux_oss@crudebyte.com, alexander.deucher@amd.com,
	viro@zeniv.linux.org.uk, willy@infradead.org, ebiggers@kernel.org,
	lucien.xin@gmail.com, bharathsm@microsoft.com,
	marcel@holtmann.org, sumit.semwal@linaro.org, Eric Paris,
	djwong@kernel.org, simona@ffwll.ch, hawk@kernel.org,
	mark.rutland@arm.com, james.clark@linaro.org,
	john.fastabend@gmail.com, dsterba@suse.com, kuniyu@google.com,
	hch@infradead.org, luiz.dentz@gmail.com, daniel@iogearbox.net,
	dwmw2@infradead.org, ncardwell@google.com, sprasad@microsoft.com,
	marcelo.leitner@gmail.com, edumazet@google.com,
	rostedt@goodmis.org, jack@suse.com, mhiramat@kernel.org,
	frank.li@vivo.com, alex.aring@gmail.com, luisbg@kernel.org,
	ms@dev.tdt.de, jth@kernel.org, jlbec@evilplan.org,
	aivazian.tigran@gmail.com, anna@kernel.org, peterz@infradead.org,
	tytso@mit.edu, willemb@google.com, eric.snowberg@oracle.com,
	johan.hedberg@gmail.com, acme@kernel.org,
	ronniesahlberg@gmail.com, jaharkes@cs.cmu.edu, David Howells,
	jaegeuk@kernel.org, courmisch@gmail.com, martin@omnibond.com,
	christian.koenig@amd.com, jmorris@namei.org,
	adilger.kernel@dilger.ca, idryomov@gmail.com, brauner@kernel.org,
	Paolo Abeni, glaubitz@physik.fu-berlin.de,
	magnus.karlsson@intel.com, airlied@gmail.com, coda@cs.cmu.edu,
	casey@schaufler-ca.com, raven@themaw.net, horms@kernel.org,
	adrian.hunter@intel.com, kuba@kernel.org, muchun.song@linux.dev,
	chao@kernel.org, mathieu.desnoyers@efficios.com,
	hubcap@omnibond.com, jlayton@kernel.org, sdf@fomichev.me,
	roberto.sassu@huawei.com, Alex Markuze, chengzhihao1@huawei.com,
	mikulas@artax.karlin.mff.cuni.cz, ericvh@kernel.org,
	salah.triki@gmail.com, osalvador@suse.de,
	dmitry.kasatkin@gmail.com, sfrench@samba.org, serge@hallyn.com,
	wufan@kernel.org, al@alarsen.net, pc@manguebit.org,
	ast@kernel.org, oleg@redhat.com, slava@dubeyko.com,
	konishi.ryusuke@gmail.com, lucho@ionkov.net, dsahern@kernel.org,
	shaggy@kernel.org, richard@nod.at, marc.dionne@auristor.com,
	neil@brown.name, dan.j.williams@intel.com, mkl@pengutronix.de,
	david@kernel.org, Ingo Molnar, jack@suse.cz, code@tyhicks.com,
	steffen.klassert@secunet.com, naohiro.aota@wdc.com,
	zohar@linux.ibm.com, chuck.lever@oracle.com, irogers@google.com
  Cc: linux-sctp@vger.kernel.org, ecryptfs@vger.kernel.org,
	linux-unionfs@vger.kernel.org, apparmor@lists.ubuntu.com,
	linux-ext4@vger.kernel.org, autofs@vger.kernel.org,
	amd-gfx@lists.freedesktop.org, fsverity@lists.linux.dev,
	ntfs3@lists.linux.dev, ocfs2-devel@lists.linux.dev,
	linux-fsdevel@vger.kernel.org, linux-media@vger.kernel.org,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
	linux-integrity@vger.kernel.org, samba-technical@lists.samba.org,
	linux-nilfs@vger.kernel.org, audit@vger.kernel.org,
	selinux@vger.kernel.org, linaro-mm-sig@lists.linaro.org,
	linux-trace-kernel@vger.kernel.org, v9fs@lists.linux.dev,
	linux-xfs@vger.kernel.org, linux-x25@vger.kernel.org,
	linux-f2fs-devel@lists.sourceforge.net,
	linux-bluetooth@vger.kernel.org, nvdimm@lists.linux.dev,
	ceph-devel@vger.kernel.org, jfs-discussion@lists.sourceforge.net,
	linux-mtd@lists.infradead.org, devel@lists.orangefs.org,
	linux-afs@lists.infradead.org, linux-fscrypt@vger.kernel.org,
	linux-security-module@vger.kernel.org, linux-cifs@vger.kernel.org,
	linux-hams@vger.kernel.org, bpf@vger.kernel.org,
	linux-can@vger.kernel.org, linux-nfs@vger.kernel.org,
	codalist@coda.cs.cmu.edu, linux-mm@kvack.org,
	netfs@lists.linux.dev, linux-perf-users@vger.kernel.org,
	dri-devel@lists.freedesktop.org
In-Reply-To: <20260302-iino-u64-v2-31-e5388800dae0@kernel.org>

On Mon, 2026-03-02 at 15:24 -0500, Jeff Layton wrote:
> Convert hfs i_ino format strings to use the PRIino format
> macro in preparation for the widening of i_ino via kino_t.
> 
> Signed-off-by: Jeff Layton <jlayton@kernel.org>
> ---
>  fs/hfs/catalog.c | 2 +-
>  fs/hfs/extent.c  | 4 ++--
>  fs/hfs/inode.c   | 4 ++--
>  3 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/fs/hfs/catalog.c b/fs/hfs/catalog.c
> index b80ba40e38776123759df4b85c7f65daa19c6436..b07c0a3ffc61584165e8cc9f646de6066a6ad2c9 100644
> --- a/fs/hfs/catalog.c
> +++ b/fs/hfs/catalog.c
> @@ -417,7 +417,7 @@ int hfs_cat_move(u32 cnid, struct inode *src_dir, const struct qstr *src_name,
>  	int entry_size, type;
>  	int err;
>  
> -	hfs_dbg("cnid %u - (ino %lu, name %s) - (ino %lu, name %s)\n",
> +	hfs_dbg("cnid %u - (ino %" PRIino "u, name %s) - (ino %" PRIino "u, name %s)\n",
>  		cnid, src_dir->i_ino, src_name->name,
>  		dst_dir->i_ino, dst_name->name);
>  	sb = src_dir->i_sb;
> diff --git a/fs/hfs/extent.c b/fs/hfs/extent.c
> index a097908b269d0ad1575847dd01d6d4a4538262bf..60875cc23880b758bbbb5e4b8281d9ee1f2dbcbb 100644
> --- a/fs/hfs/extent.c
> +++ b/fs/hfs/extent.c
> @@ -411,7 +411,7 @@ int hfs_extend_file(struct inode *inode)
>  		goto out;
>  	}
>  
> -	hfs_dbg("ino %lu, start %u, len %u\n", inode->i_ino, start, len);
> +	hfs_dbg("ino %" PRIino "u, start %u, len %u\n", inode->i_ino, start, len);
>  	if (HFS_I(inode)->alloc_blocks == HFS_I(inode)->first_blocks) {
>  		if (!HFS_I(inode)->first_blocks) {
>  			hfs_dbg("first_extent: start %u, len %u\n",
> @@ -482,7 +482,7 @@ void hfs_file_truncate(struct inode *inode)
>  	u32 size;
>  	int res;
>  
> -	hfs_dbg("ino %lu, phys_size %llu -> i_size %llu\n",
> +	hfs_dbg("ino %" PRIino "u, phys_size %llu -> i_size %llu\n",
>  		inode->i_ino, (long long)HFS_I(inode)->phys_size,
>  		inode->i_size);
>  	if (inode->i_size > HFS_I(inode)->phys_size) {
> diff --git a/fs/hfs/inode.c b/fs/hfs/inode.c
> index 878535db64d679995cd1f5c215f56c5258c3c720..b19866525c1e9c43decf3a943c709922ee8630f6 100644
> --- a/fs/hfs/inode.c
> +++ b/fs/hfs/inode.c
> @@ -270,7 +270,7 @@ void hfs_delete_inode(struct inode *inode)
>  {
>  	struct super_block *sb = inode->i_sb;
>  
> -	hfs_dbg("ino %lu\n", inode->i_ino);
> +	hfs_dbg("ino %" PRIino "u\n", inode->i_ino);
>  	if (S_ISDIR(inode->i_mode)) {
>  		atomic64_dec(&HFS_SB(sb)->folder_count);
>  		if (HFS_I(inode)->cat_key.ParID == cpu_to_be32(HFS_ROOT_CNID))
> @@ -455,7 +455,7 @@ int hfs_write_inode(struct inode *inode, struct writeback_control *wbc)
>  	hfs_cat_rec rec;
>  	int res;
>  
> -	hfs_dbg("ino %lu\n", inode->i_ino);
> +	hfs_dbg("ino %" PRIino "u\n", inode->i_ino);
>  	res = hfs_ext_write_extent(inode);
>  	if (res)
>  		return res;

Reviewed-by: Viacheslav Dubeyko <slava@dubeyko.com>

Thanks,
Slava.

^ permalink raw reply

* Re:  [PATCH v2 023/110] ceph: use PRIino format for i_ino
From: Viacheslav Dubeyko @ 2026-03-02 22:24 UTC (permalink / raw)
  To: socketcan@hartkopp.net, herbert@gondor.apana.org.au,
	jolsa@kernel.org, jreuter@yaina.de, Dai.Ngo@oracle.com,
	Ondrej Mosnacek, davem@davemloft.net, dlemoal@kernel.org,
	trondmy@kernel.org, namhyung@kernel.org,
	almaz.alexandrovich@paragon-software.com, miklos@szeredi.hu,
	john.johansen@canonical.com, stephen.smalley.work@gmail.com,
	nico@fluxnic.net, maciej.fijalkowski@intel.com, Olga Kornievskaia,
	amir73il@gmail.com, tom@talpey.com, joseph.qi@linux.alibaba.com,
	paul@paul-moore.com, asmadeus@codewreck.org,
	alexander.shishkin@linux.intel.com, mark@fasheh.com,
	linux_oss@crudebyte.com, alexander.deucher@amd.com,
	viro@zeniv.linux.org.uk, willy@infradead.org, ebiggers@kernel.org,
	lucien.xin@gmail.com, bharathsm@microsoft.com,
	marcel@holtmann.org, sumit.semwal@linaro.org, Eric Paris,
	djwong@kernel.org, simona@ffwll.ch, hawk@kernel.org,
	mark.rutland@arm.com, james.clark@linaro.org,
	john.fastabend@gmail.com, dsterba@suse.com, kuniyu@google.com,
	hch@infradead.org, luiz.dentz@gmail.com, daniel@iogearbox.net,
	dwmw2@infradead.org, ncardwell@google.com, sprasad@microsoft.com,
	marcelo.leitner@gmail.com, edumazet@google.com,
	rostedt@goodmis.org, jack@suse.com, mhiramat@kernel.org,
	frank.li@vivo.com, alex.aring@gmail.com, luisbg@kernel.org,
	ms@dev.tdt.de, jth@kernel.org, jlbec@evilplan.org,
	aivazian.tigran@gmail.com, anna@kernel.org, peterz@infradead.org,
	tytso@mit.edu, willemb@google.com, eric.snowberg@oracle.com,
	johan.hedberg@gmail.com, acme@kernel.org,
	ronniesahlberg@gmail.com, jaharkes@cs.cmu.edu, David Howells,
	jaegeuk@kernel.org, courmisch@gmail.com, martin@omnibond.com,
	christian.koenig@amd.com, jmorris@namei.org,
	adilger.kernel@dilger.ca, idryomov@gmail.com, brauner@kernel.org,
	Paolo Abeni, glaubitz@physik.fu-berlin.de,
	magnus.karlsson@intel.com, airlied@gmail.com, coda@cs.cmu.edu,
	casey@schaufler-ca.com, raven@themaw.net, horms@kernel.org,
	adrian.hunter@intel.com, kuba@kernel.org, muchun.song@linux.dev,
	chao@kernel.org, mathieu.desnoyers@efficios.com,
	hubcap@omnibond.com, jlayton@kernel.org, sdf@fomichev.me,
	roberto.sassu@huawei.com, Alex Markuze, chengzhihao1@huawei.com,
	mikulas@artax.karlin.mff.cuni.cz, ericvh@kernel.org,
	salah.triki@gmail.com, osalvador@suse.de,
	dmitry.kasatkin@gmail.com, sfrench@samba.org, serge@hallyn.com,
	wufan@kernel.org, al@alarsen.net, pc@manguebit.org,
	ast@kernel.org, oleg@redhat.com, slava@dubeyko.com,
	konishi.ryusuke@gmail.com, lucho@ionkov.net, dsahern@kernel.org,
	shaggy@kernel.org, richard@nod.at, marc.dionne@auristor.com,
	neil@brown.name, dan.j.williams@intel.com, mkl@pengutronix.de,
	david@kernel.org, Ingo Molnar, jack@suse.cz, code@tyhicks.com,
	steffen.klassert@secunet.com, naohiro.aota@wdc.com,
	zohar@linux.ibm.com, chuck.lever@oracle.com, irogers@google.com
  Cc: linux-sctp@vger.kernel.org, ecryptfs@vger.kernel.org,
	linux-unionfs@vger.kernel.org, apparmor@lists.ubuntu.com,
	linux-ext4@vger.kernel.org, autofs@vger.kernel.org,
	amd-gfx@lists.freedesktop.org, fsverity@lists.linux.dev,
	ntfs3@lists.linux.dev, ocfs2-devel@lists.linux.dev,
	linux-fsdevel@vger.kernel.org, linux-media@vger.kernel.org,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
	linux-integrity@vger.kernel.org, samba-technical@lists.samba.org,
	linux-nilfs@vger.kernel.org, audit@vger.kernel.org,
	selinux@vger.kernel.org, linaro-mm-sig@lists.linaro.org,
	linux-trace-kernel@vger.kernel.org, v9fs@lists.linux.dev,
	linux-xfs@vger.kernel.org, linux-x25@vger.kernel.org,
	linux-f2fs-devel@lists.sourceforge.net,
	linux-bluetooth@vger.kernel.org, nvdimm@lists.linux.dev,
	ceph-devel@vger.kernel.org, jfs-discussion@lists.sourceforge.net,
	linux-mtd@lists.infradead.org, devel@lists.orangefs.org,
	linux-afs@lists.infradead.org, linux-fscrypt@vger.kernel.org,
	linux-security-module@vger.kernel.org, linux-cifs@vger.kernel.org,
	linux-hams@vger.kernel.org, bpf@vger.kernel.org,
	linux-can@vger.kernel.org, linux-nfs@vger.kernel.org,
	codalist@coda.cs.cmu.edu, linux-mm@kvack.org,
	netfs@lists.linux.dev, linux-perf-users@vger.kernel.org,
	dri-devel@lists.freedesktop.org
In-Reply-To: <20260302-iino-u64-v2-23-e5388800dae0@kernel.org>

On Mon, 2026-03-02 at 15:24 -0500, Jeff Layton wrote:
> Convert ceph i_ino format strings to use the PRIino format
> macro in preparation for the widening of i_ino via kino_t.
> 
> Also correct signed format specifiers to unsigned, since inode
> numbers are unsigned values.
> 
> Signed-off-by: Jeff Layton <jlayton@kernel.org>
> ---
>  fs/ceph/crypto.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/ceph/crypto.c b/fs/ceph/crypto.c
> index f3de43ccb470ddbd7945426d79f9024ae615c127..718c194ba5d8ce22c6a5d1dd687ec3761263e7e1 100644
> --- a/fs/ceph/crypto.c
> +++ b/fs/ceph/crypto.c
> @@ -272,7 +272,7 @@ int ceph_encode_encrypted_dname(struct inode *parent, char *buf, int elen)
>  	/* To understand the 240 limit, see CEPH_NOHASH_NAME_MAX comments */
>  	WARN_ON(elen > 240);
>  	if (dir != parent) // leading _ is already there; append _<inum>
> -		elen += 1 + sprintf(p + elen, "_%ld", dir->i_ino);
> +		elen += 1 + sprintf(p + elen, "_%" PRIino "u", dir->i_ino);
>  
>  out:
>  	kfree(cryptbuf);
> @@ -377,7 +377,7 @@ int ceph_fname_to_usr(const struct ceph_fname *fname, struct fscrypt_str *tname,
>  	if (!ret && (dir != fname->dir)) {
>  		char tmp_buf[BASE64_CHARS(NAME_MAX)];
>  
> -		name_len = snprintf(tmp_buf, sizeof(tmp_buf), "_%.*s_%ld",
> +		name_len = snprintf(tmp_buf, sizeof(tmp_buf), "_%.*s_%" PRIino "u",
>  				    oname->len, oname->name, dir->i_ino);
>  		memcpy(oname->name, tmp_buf, name_len);
>  		oname->len = name_len;

Looks good.

Reviewed-by: Viacheslav Dubeyko <Slava.Dubeyko@ibm.com>

Thanks,
Slava.

^ permalink raw reply

* [PATCH v2 2/2] jbd2: gracefully abort on transaction state corruptions
From: Milos Nikic @ 2026-03-02 21:34 UTC (permalink / raw)
  To: jack; +Cc: tytso, linux-ext4, linux-kernel, Milos Nikic
In-Reply-To: <20260302213425.273187-1-nikic.milos@gmail.com>

Auditing the jbd2 codebase reveals several legacy J_ASSERT calls
that enforce internal state machine invariants (e.g., verifying
jh->b_transaction or jh->b_next_transaction pointers).

When these invariants are broken, the journal is in a corrupted
state. However, triggering a fatal panic brings down the entire
system for a localized filesystem error.

This patch targets a specific class of these asserts: those
residing inside functions that natively return integer error codes,
booleans, or error pointers. It replaces the hard J_ASSERTs with
WARN_ON_ONCE to capture the offending stack trace, safely drops
any held locks, gracefully aborts the journal, and returns -EINVAL.

This prevents a catastrophic kernel panic while ensuring the
corrupted journal state is safely contained and upstream callers
(like ext4 or ocfs2) can gracefully handle the aborted handle.

Functions modified in fs/jbd2/transaction.c:
- jbd2__journal_start()
- do_get_write_access()
- jbd2_journal_dirty_metadata()
- jbd2_journal_forget()
- jbd2_journal_try_to_free_buffers()
- jbd2_journal_file_inode()

Signed-off-by: Milos Nikic <nikic.milos@gmail.com>
---
 fs/jbd2/transaction.c | 95 +++++++++++++++++++++++++++++++++----------
 1 file changed, 74 insertions(+), 21 deletions(-)

diff --git a/fs/jbd2/transaction.c b/fs/jbd2/transaction.c
index 04d17a5f2a82..85e9338ed999 100644
--- a/fs/jbd2/transaction.c
+++ b/fs/jbd2/transaction.c
@@ -474,7 +474,8 @@ handle_t *jbd2__journal_start(journal_t *journal, int nblocks, int rsv_blocks,
 		return ERR_PTR(-EROFS);
 
 	if (handle) {
-		J_ASSERT(handle->h_transaction->t_journal == journal);
+		if (WARN_ON_ONCE(handle->h_transaction->t_journal != journal))
+			return ERR_PTR(-EINVAL);
 		handle->h_ref++;
 		return handle;
 	}
@@ -1036,7 +1037,13 @@ do_get_write_access(handle_t *handle, struct journal_head *jh,
 	 */
 	if (!jh->b_transaction) {
 		JBUFFER_TRACE(jh, "no transaction");
-		J_ASSERT_JH(jh, !jh->b_next_transaction);
+		if (WARN_ON_ONCE(jh->b_next_transaction)) {
+			spin_unlock(&jh->b_state_lock);
+			unlock_buffer(bh);
+			error = -EINVAL;
+			jbd2_journal_abort(journal, error);
+			goto out;
+		}
 		JBUFFER_TRACE(jh, "file as BJ_Reserved");
 		/*
 		 * Make sure all stores to jh (b_modified, b_frozen_data) are
@@ -1069,13 +1076,24 @@ do_get_write_access(handle_t *handle, struct journal_head *jh,
 	 */
 	if (jh->b_frozen_data) {
 		JBUFFER_TRACE(jh, "has frozen data");
-		J_ASSERT_JH(jh, jh->b_next_transaction == NULL);
+		if (WARN_ON_ONCE(jh->b_next_transaction)) {
+			spin_unlock(&jh->b_state_lock);
+			error = -EINVAL;
+			jbd2_journal_abort(journal, error);
+			goto out;
+		}
 		goto attach_next;
 	}
 
 	JBUFFER_TRACE(jh, "owned by older transaction");
-	J_ASSERT_JH(jh, jh->b_next_transaction == NULL);
-	J_ASSERT_JH(jh, jh->b_transaction == journal->j_committing_transaction);
+	if (WARN_ON_ONCE(jh->b_next_transaction ||
+			 jh->b_transaction !=
+			 journal->j_committing_transaction)) {
+		spin_unlock(&jh->b_state_lock);
+		error = -EINVAL;
+		jbd2_journal_abort(journal, error);
+		goto out;
+	}
 
 	/*
 	 * There is one case we have to be very careful about.  If the
@@ -1520,8 +1538,11 @@ int jbd2_journal_dirty_metadata(handle_t *handle, struct buffer_head *bh)
 	if (data_race(jh->b_transaction != transaction &&
 	    jh->b_next_transaction != transaction)) {
 		spin_lock(&jh->b_state_lock);
-		J_ASSERT_JH(jh, jh->b_transaction == transaction ||
-				jh->b_next_transaction == transaction);
+		if (WARN_ON_ONCE(jh->b_transaction != transaction &&
+				 jh->b_next_transaction != transaction)) {
+			ret = -EINVAL;
+			goto out_unlock_bh;
+		}
 		spin_unlock(&jh->b_state_lock);
 	}
 	if (data_race(jh->b_modified == 1)) {
@@ -1536,8 +1557,11 @@ int jbd2_journal_dirty_metadata(handle_t *handle, struct buffer_head *bh)
 				       handle->h_type, handle->h_line_no,
 				       (unsigned long long) bh->b_blocknr,
 				       jh->b_jlist);
-			J_ASSERT_JH(jh, jh->b_transaction != transaction ||
-					jh->b_jlist == BJ_Metadata);
+			if (WARN_ON_ONCE(jh->b_transaction == transaction &&
+					 jh->b_jlist != BJ_Metadata)) {
+				ret = -EINVAL;
+				goto out_unlock_bh;
+			}
 			spin_unlock(&jh->b_state_lock);
 		}
 		goto out;
@@ -1636,7 +1660,10 @@ int jbd2_journal_dirty_metadata(handle_t *handle, struct buffer_head *bh)
 	}
 
 	/* That test should have eliminated the following case: */
-	J_ASSERT_JH(jh, jh->b_frozen_data == NULL);
+	if (WARN_ON_ONCE(jh->b_frozen_data)) {
+		ret = -EINVAL;
+		goto out_unlock_bh;
+	}
 
 	JBUFFER_TRACE(jh, "file as BJ_Metadata");
 	spin_lock(&journal->j_list_lock);
@@ -1675,6 +1702,7 @@ int jbd2_journal_forget(handle_t *handle, struct buffer_head *bh)
 	int err = 0;
 	int was_modified = 0;
 	int wait_for_writeback = 0;
+	int abort_journal = 0;
 
 	if (is_handle_aborted(handle))
 		return -EROFS;
@@ -1708,7 +1736,11 @@ int jbd2_journal_forget(handle_t *handle, struct buffer_head *bh)
 	jh->b_modified = 0;
 
 	if (jh->b_transaction == transaction) {
-		J_ASSERT_JH(jh, !jh->b_frozen_data);
+		if (WARN_ON_ONCE(jh->b_frozen_data)) {
+			err = -EINVAL;
+			abort_journal = 1;
+			goto drop;
+		}
 
 		/* If we are forgetting a buffer which is already part
 		 * of this transaction, then we can just drop it from
@@ -1747,8 +1779,11 @@ int jbd2_journal_forget(handle_t *handle, struct buffer_head *bh)
 		}
 		spin_unlock(&journal->j_list_lock);
 	} else if (jh->b_transaction) {
-		J_ASSERT_JH(jh, (jh->b_transaction ==
-				 journal->j_committing_transaction));
+		if (WARN_ON_ONCE(jh->b_transaction != journal->j_committing_transaction)) {
+			err = -EINVAL;
+			abort_journal = 1;
+			goto drop;
+		}
 		/* However, if the buffer is still owned by a prior
 		 * (committing) transaction, we can't drop it yet... */
 		JBUFFER_TRACE(jh, "belongs to older transaction");
@@ -1766,7 +1801,11 @@ int jbd2_journal_forget(handle_t *handle, struct buffer_head *bh)
 			jh->b_next_transaction = transaction;
 			spin_unlock(&journal->j_list_lock);
 		} else {
-			J_ASSERT(jh->b_next_transaction == transaction);
+			if (WARN_ON_ONCE(jh->b_next_transaction != transaction)) {
+				err = -EINVAL;
+				abort_journal = 1;
+				goto drop;
+			}
 
 			/*
 			 * only drop a reference if this transaction modified
@@ -1812,6 +1851,8 @@ int jbd2_journal_forget(handle_t *handle, struct buffer_head *bh)
 drop:
 	__brelse(bh);
 	spin_unlock(&jh->b_state_lock);
+	if (abort_journal)
+		jbd2_journal_abort(journal, err);
 	if (wait_for_writeback)
 		wait_on_buffer(bh);
 	jbd2_journal_put_journal_head(jh);
@@ -2136,7 +2177,8 @@ bool jbd2_journal_try_to_free_buffers(journal_t *journal, struct folio *folio)
 	struct buffer_head *bh;
 	bool ret = false;
 
-	J_ASSERT(folio_test_locked(folio));
+	if (WARN_ON_ONCE(!folio_test_locked(folio)))
+		return false;
 
 	head = folio_buffers(folio);
 	bh = head;
@@ -2651,6 +2693,8 @@ static int jbd2_journal_file_inode(handle_t *handle, struct jbd2_inode *jinode,
 {
 	transaction_t *transaction = handle->h_transaction;
 	journal_t *journal;
+	int err = 0;
+	int abort_transaction = 0;
 
 	if (is_handle_aborted(handle))
 		return -EROFS;
@@ -2685,20 +2729,29 @@ static int jbd2_journal_file_inode(handle_t *handle, struct jbd2_inode *jinode,
 	/* On some different transaction's list - should be
 	 * the committing one */
 	if (jinode->i_transaction) {
-		J_ASSERT(jinode->i_next_transaction == NULL);
-		J_ASSERT(jinode->i_transaction ==
-					journal->j_committing_transaction);
+		if (WARN_ON_ONCE(jinode->i_next_transaction ||
+				 jinode->i_transaction !=
+				 journal->j_committing_transaction)) {
+			err = -EINVAL;
+			abort_transaction = 1;
+			goto done;
+		}
 		jinode->i_next_transaction = transaction;
 		goto done;
 	}
 	/* Not on any transaction list... */
-	J_ASSERT(!jinode->i_next_transaction);
+	if (WARN_ON_ONCE(jinode->i_next_transaction)) {
+		err = -EINVAL;
+		abort_transaction = 1;
+		goto done;
+	}
 	jinode->i_transaction = transaction;
 	list_add(&jinode->i_list, &transaction->t_inode_list);
 done:
 	spin_unlock(&journal->j_list_lock);
-
-	return 0;
+	if (abort_transaction)
+		jbd2_journal_abort(journal, err);
+	return err;
 }
 
 int jbd2_journal_inode_ranged_write(handle_t *handle,
-- 
2.53.0


^ permalink raw reply related

* [PATCH v2 1/2] jbd2: gracefully abort instead of panicking on unlocked buffer
From: Milos Nikic @ 2026-03-02 21:34 UTC (permalink / raw)
  To: jack; +Cc: tytso, linux-ext4, linux-kernel, Milos Nikic, Zhang Yi
In-Reply-To: <20260302213425.273187-1-nikic.milos@gmail.com>

In jbd2_journal_get_create_access(), if the caller passes an unlocked
buffer, the code currently triggers a fatal J_ASSERT.

While an unlocked buffer here is a clear API violation and a bug in the
caller, crashing the entire system is an overly severe response. It brings
down the whole machine for a localized filesystem inconsistency.

Replace the J_ASSERT with a WARN_ON_ONCE to capture the offending caller's
stack trace, and return an error (-EINVAL). This allows the journal to
gracefully abort the transaction, protecting data integrity without
causing a kernel panic.

Signed-off-by: Milos Nikic <nikic.milos@gmail.com>
Reviewed-by: Zhang Yi <yi.zhang@huawei.com>
Reviewed-by: Jan Kara <jack@suse.cz>
---
 fs/jbd2/transaction.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/fs/jbd2/transaction.c b/fs/jbd2/transaction.c
index dca4b5d8aaaa..04d17a5f2a82 100644
--- a/fs/jbd2/transaction.c
+++ b/fs/jbd2/transaction.c
@@ -1302,7 +1302,12 @@ int jbd2_journal_get_create_access(handle_t *handle, struct buffer_head *bh)
 		goto out;
 	}
 
-	J_ASSERT_JH(jh, buffer_locked(jh2bh(jh)));
+	if (WARN_ON_ONCE(!buffer_locked(jh2bh(jh)))) {
+		err = -EINVAL;
+		spin_unlock(&jh->b_state_lock);
+		jbd2_journal_abort(journal, err);
+		goto out;
+	}
 
 	if (jh->b_transaction == NULL) {
 		/*
-- 
2.53.0


^ permalink raw reply related


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