mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mark Shislov <marks.sislovs@gmail.com>
To: shaggy@kernel.org
Cc: jfs-discussion@lists.sourceforge.net,
	linux-kernel@vger.kernel.org,
	Mark Shislov <marks.sislovs@gmail.com>
Subject: [PATCH] jfs: make remounting with a changed nointegrity option work again
Date: Wed,  2 Dec 2026 23:09:12 +0200	[thread overview]
Message-ID: <20261202210912.3437967-1-marks.sislovs@gmail.com> (raw)

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@gmail.com>
---
 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


                 reply	other threads:[~2026-12-02 21:09 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20261202210912.3437967-1-marks.sislovs@gmail.com \
    --to=marks.sislovs@gmail.com \
    --cc=jfs-discussion@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=shaggy@kernel.org \
    /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®