* + nilfs2-switch-warn_ons-to-warning-output-in-nilfs_sufile_do_free.patch added to mm-nonmm-unstable branch
@ 2023-12-07 22:27 Andrew Morton
0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2023-12-07 22:27 UTC (permalink / raw)
To: mm-commits, konishi.ryusuke, akpm
The patch titled
Subject: nilfs2: switch WARN_ONs to warning output in nilfs_sufile_do_free()
has been added to the -mm mm-nonmm-unstable branch. Its filename is
nilfs2-switch-warn_ons-to-warning-output-in-nilfs_sufile_do_free.patch
This patch will shortly appear at
https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/nilfs2-switch-warn_ons-to-warning-output-in-nilfs_sufile_do_free.patch
This patch will later appear in the mm-nonmm-unstable branch at
git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next via the mm-everything
branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there every 2-3 working days
------------------------------------------------------
From: Ryusuke Konishi <konishi.ryusuke@gmail.com>
Subject: nilfs2: switch WARN_ONs to warning output in nilfs_sufile_do_free()
Date: Thu, 7 Dec 2023 13:57:30 +0900
nilfs_sufile_do_free(), which is called when log write fails or during GC,
uses WARN_ONs to check for abnormal status of metadata. In the former
case, these WARN_ONs will not be fired, but in the latter case they don't
"never-happen". It is possible to trigger these by intentionally
modifying the userland GC library to release segments that are not in the
expected state.
So, replace them with warning output using the dedicated macro
nilfs_warn().
This replaces two potentially triggered WARN_ONs with ones that use a
warning output macro.
Link: https://lkml.kernel.org/r/20231207045730.5205-1-konishi.ryusuke@gmail.com
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
fs/nilfs2/sufile.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
--- a/fs/nilfs2/sufile.c~nilfs2-switch-warn_ons-to-warning-output-in-nilfs_sufile_do_free
+++ a/fs/nilfs2/sufile.c
@@ -471,10 +471,15 @@ void nilfs_sufile_do_free(struct inode *
kunmap_atomic(kaddr);
return;
}
- WARN_ON(nilfs_segment_usage_error(su));
- WARN_ON(!nilfs_segment_usage_dirty(su));
+ if (unlikely(nilfs_segment_usage_error(su)))
+ nilfs_warn(sufile->i_sb, "free segment %llu marked in error",
+ (unsigned long long)segnum);
sudirty = nilfs_segment_usage_dirty(su);
+ if (unlikely(!sudirty))
+ nilfs_warn(sufile->i_sb, "free unallocated segment %llu",
+ (unsigned long long)segnum);
+
nilfs_segment_usage_set_clean(su);
kunmap_atomic(kaddr);
mark_buffer_dirty(su_bh);
_
Patches currently in -mm which might be from konishi.ryusuke@gmail.com are
nilfs2-move-page-release-outside-of-nilfs_delete_entry-and-nilfs_set_link.patch
nilfs2-eliminate-staggered-calls-to-kunmap-in-nilfs_rename.patch
nilfs2-switch-warn_ons-to-warning-output-in-nilfs_sufile_do_free.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-12-07 22:28 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-07 22:27 + nilfs2-switch-warn_ons-to-warning-output-in-nilfs_sufile_do_free.patch added to mm-nonmm-unstable branch Andrew Morton
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.