Re: [PATCH] fs: efs: Fix compilation bug and use pr_debug()
From: Andrew Morton
Date: Thu Jun 04 2026 - 17:30:51 EST
(cc linux-fsdevel)
On Thu, 4 Jun 2026 15:24:40 -0500 Maxwell Doose <m32285159@xxxxxxxxx> wrote:
> Firstly, the current code uses formatters that are incompatible with the
> most recent GCC for x86_64. Replace them and explicitly cast the
> formatted variables to their respective forms of long long.
Please quote the compiler output in the changelog.
> Secondly, replace the legacy conditional compilation for DEBUG with the
> more preferred pr_debug() to condense the code, while keeping the final
> output functionally identical.
>
> Fixes: f403d1dbac6d ("fs/efs: add pr_fmt / use __func__")
>
> ...
>
> Test compiled only with gcc 16.1.1 for x86_64.
Compiled how? DEBUG was defined in some fashion?
> --- a/fs/efs/file.c
> +++ b/fs/efs/file.c
> @@ -19,13 +19,12 @@ int efs_get_block(struct inode *inode, sector_t iblock,
> if (create)
> return error;
> if (iblock >= inode->i_blocks) {
> -#ifdef DEBUG
> /*
> * i have no idea why this happens as often as it does
> */
> - pr_warn("%s(): block %d >= %ld (filesize %ld)\n",
> - __func__, block, inode->i_blocks, inode->i_size);
That wouldn't have compiled anyway - `block' is undefined?
> -#endif
> + pr_debug("EFS: block %llu >= %llu (filesize %lld)\n",
> + (unsigned long long)iblock, (unsigned long long)inode->i_blocks,
> + (long long)inode->i_size);
It seems that nowadays sector_t and blkcnt_t are unconditionally u64
and loff_t is unconditionally `long long'. I think, please check.
If so, no casts are needed.
> return 0;
> }
> phys = efs_map_block(inode, iblock);
> @@ -43,13 +42,12 @@ int efs_bmap(struct inode *inode, efs_block_t block) {
>
> /* are we about to read past the end of a file ? */
> if (!(block < inode->i_blocks)) {
> -#ifdef DEBUG
> /*
> * i have no idea why this happens as often as it does
> */
> - pr_warn("%s(): block %d >= %ld (filesize %ld)\n",
> - __func__, block, inode->i_blocks, inode->i_size);
> -#endif
> + pr_debug("EFS: block %llu >= %llu (filesize %lld)\n",
> + (unsigned long long)block, (unsigned long long)inode->i_blocks,
> + (long long)inode->i_size);
> return 0;
> }