mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2] fs: efs: Remove unneeded debug prints
@ 2026-06-05  3:52 Maxwell Doose
  2026-06-23 10:09 ` Christian Brauner
  0 siblings, 1 reply; 3+ messages in thread
From: Maxwell Doose @ 2026-06-05  3:52 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-fsdevel, Maxwell Doose, Fabian Frederick, open list

The current code uses debug prints conditionally compiled with #ifdef
DEBUG. However, that code, when compiled, causes compiler errors due to
incompatible formatters and undefined variables, notably:

fs/efs/file.c: In function ‘efs_get_block’:
fs/efs/file.c:26:35: error: ‘block’ undeclared (first use in this
function); did you mean ‘iblock’?
  26 |                         __func__, block, inode->i_blocks, inode->i_size);
     |                                   ^~~~~

and:

fs/efs/file.c: In function ‘efs_bmap’:
./include/linux/kern_levels.h:5:25: error: format ‘%ld’ expects
argument of type ‘long int’, but argument 4 has type ‘blkcnt_t’ {aka
‘long long unsigned int’} [-Werror=format=]
   5 | #define KERN_SOH        "\001"          /* ASCII Start Of Header */
     |                         ^~~~~~

which also extends to the other formatters. As this part of the code has
been dead for just about 14 years now, it has not been modernized to
stay compatible with the most recent gcc compilers. Fix these issues by
removing the debug prints.

Suggested-by: Andrew Morton <akpm@linux-foundation.org>
Fixes: f403d1dbac6d ("fs/efs: add pr_fmt / use __func__")
Signed-off-by: Maxwell Doose <m32285159@gmail.com>
---
 v2:
 - Change commit to remove debug prints instead of updating them to
   pr_debug() per Andrew's suggestion.
 - Change commit message to include compiler errors noted by gcc per
   Andrew's suggestion.

 fs/efs/file.c | 21 +++------------------
 1 file changed, 3 insertions(+), 18 deletions(-)

diff --git a/fs/efs/file.c b/fs/efs/file.c
index 9e641da6fab2..9153dfe79bbc 100644
--- a/fs/efs/file.c
+++ b/fs/efs/file.c
@@ -18,16 +18,9 @@ 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);
-#endif
+	if (iblock >= inode->i_blocks)
 		return 0;
-	}
+
 	phys = efs_map_block(inode, iblock);
 	if (phys)
 		map_bh(bh_result, inode->i_sb, phys);
@@ -42,16 +35,8 @@ 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
+	if (!(block < inode->i_blocks))
 		return 0;
-	}
 
 	return efs_map_block(inode, block);
 }
-- 
2.54.0


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

* Re: [PATCH v2] fs: efs: Remove unneeded debug prints
  2026-06-05  3:52 [PATCH v2] fs: efs: Remove unneeded debug prints Maxwell Doose
@ 2026-06-23 10:09 ` Christian Brauner
  2026-06-23 16:20   ` Matthew Wilcox
  0 siblings, 1 reply; 3+ messages in thread
From: Christian Brauner @ 2026-06-23 10:09 UTC (permalink / raw)
  To: Andrew Morton, Maxwell Doose
  Cc: linux-fsdevel, Fabian Frederick, linux-kernel

On Thu, 04 Jun 2026 22:52:51 -0500, Maxwell Doose wrote:
> fs: efs: Remove unneeded debug prints

Applied to the vfs-7.3.misc branch of the vfs/vfs.git tree.
Patches in the vfs-7.3.misc branch should appear in linux-next soon.

Please report any outstanding bugs that were missed during review in a
new review to the original patch series allowing us to drop it.

It's encouraged to provide Acked-bys and Reviewed-bys even though the
patch has now been applied. If possible patch trailers will be updated.

Note that commit hashes shown below are subject to change due to rebase,
trailer updates or similar. If in doubt, please check the listed branch.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git
branch: vfs-7.3.misc

[1/1] fs: efs: Remove unneeded debug prints
      https://git.kernel.org/vfs/vfs/c/1fb3f646c9d1


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

* Re: [PATCH v2] fs: efs: Remove unneeded debug prints
  2026-06-23 10:09 ` Christian Brauner
@ 2026-06-23 16:20   ` Matthew Wilcox
  0 siblings, 0 replies; 3+ messages in thread
From: Matthew Wilcox @ 2026-06-23 16:20 UTC (permalink / raw)
  To: Christian Brauner
  Cc: Andrew Morton, Maxwell Doose, linux-fsdevel, Fabian Frederick,
	linux-kernel

On Tue, Jun 23, 2026 at 12:09:06PM +0200, Christian Brauner wrote:
> On Thu, 04 Jun 2026 22:52:51 -0500, Maxwell Doose wrote:
> > fs: efs: Remove unneeded debug prints
> 
> Applied to the vfs-7.3.misc branch of the vfs/vfs.git tree.
> Patches in the vfs-7.3.misc branch should appear in linux-next soon.

Too late; Andrew already merged this as 89009392c80d

Plus, it'd be better to just delete the whole filesystem.
https://lore.kernel.org/linux-fsdevel/20260618211822.3599089-1-willy@infradead.org/

(now has a slight conflict as this patch has been merged)

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

end of thread, other threads:[~2026-06-23 16:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-05  3:52 [PATCH v2] fs: efs: Remove unneeded debug prints Maxwell Doose
2026-06-23 10:09 ` Christian Brauner
2026-06-23 16:20   ` Matthew Wilcox

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®