mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Maxwell Doose <m32285159@gmail.com>
Cc: Fabian Frederick <fabf@skynet.be>,
	linux-kernel@vger.kernel.org (open list),
	linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH] fs: efs: Fix compilation bug and use pr_debug()
Date: Thu, 4 Jun 2026 14:30:40 -0700	[thread overview]
Message-ID: <20260604143040.61f70396c568b7433110fb3d@linux-foundation.org> (raw)
In-Reply-To: <20260604202441.65226-1-m32285159@gmail.com>

(cc linux-fsdevel)

On Thu,  4 Jun 2026 15:24:40 -0500 Maxwell Doose <m32285159@gmail.com> 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;
>  	}


  reply	other threads:[~2026-06-04 21:30 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-04 20:24 Maxwell Doose
2026-06-04 21:30 ` Andrew Morton [this message]
2026-06-05  1:40   ` Maxwell Doose
2026-06-05  2:53     ` Andrew Morton
2026-06-05  3:16       ` Maxwell Doose
2026-06-05  3:27         ` Matthew Wilcox
2026-06-05  3:33           ` Maxwell Doose
2026-06-05 16:59             ` Matthew Wilcox

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260604143040.61f70396c568b7433110fb3d@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=fabf@skynet.be \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=m32285159@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®