[PATCH] jfs: make remounting with a changed nointegrity option work again
From: Mark Shislov
Date: Wed Dec 02 2026 - 16:09:22 EST
jfs_reconfigure() switches between the real log and the dummy log when
the nointegrity option changes on a read-write remount:
if ((JFS_SBI(sb)->flag & JFS_NOINTEGRITY) !=
(flag & JFS_NOINTEGRITY)) {
...
rc = jfs_umount_rw(sb);
...
JFS_SBI(sb)->flag = flag;
ret = jfs_mount_rw(sb, 1);
Since commit 945be8ca819e ("jfs: convert jfs to use the new mount api"),
the parsed flags are copied into sbi->flag at the top of
jfs_reconfigure(), before this comparison, so the two sides are always
equal and the log is never switched. "mount -o remount,nointegrity" on
a read-write filesystem succeeds and /proc/mounts reports nointegrity,
but the filesystem keeps using its real log, and the reverse change is
ignored in the same way. The read-write to read-only branch is also
affected: jfs_umount_rw() now runs with the new flags rather than the
ones the log was opened with, so updateSuper() can pick the wrong path
when nointegrity is changed together with ro.
Every branch below already sets sbi->flag at the point where the old
code did, so drop the early assignment and restore the previous
behaviour.
With this change, remounting a read-write filesystem with nointegrity
marks the on-disk superblock dirty (FM_DIRTY) as a nointegrity mount
does, and remounting with integrity marks it mounted (FM_MOUNT) again;
without it, the superblock state does not change.
Fixes: 945be8ca819e ("jfs: convert jfs to use the new mount api")
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Mark Shislov <marks.sislovs@xxxxxxxxx>
---
fs/jfs/super.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/fs/jfs/super.c b/fs/jfs/super.c
index 8180d83d33fe..ea2c5a5c7f9d 100644
--- a/fs/jfs/super.c
+++ b/fs/jfs/super.c
@@ -369,8 +369,11 @@ static int jfs_reconfigure(struct fs_context *fc)
sync_filesystem(sb);
- /* Transfer results of parsing to the sbi */
- JFS_SBI(sb)->flag = ctx->flag;
+ /*
+ * Transfer results of parsing to the sbi. sbi->flag is updated
+ * below, once the log has been closed with the old flags, so that
+ * a change of the nointegrity option can be detected.
+ */
JFS_SBI(sb)->uid = ctx->uid;
JFS_SBI(sb)->gid = ctx->gid;
JFS_SBI(sb)->umask = ctx->umask;
base-commit: 0df89587a56e0f0392a9d5380334fb87ec4f2690
--
2.56.1