From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.160.175 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796441326; b=Ha++BKF+sh1QBnF+68KUtcSEnyskogEogyKaRMQJ8X0BTe7dWX9zM6a7z5bC7V/caTRI JLwHLdw40b8cTPev7pmObUGE5/gYBHQDxE87PwfQB2ybvSmEctMi0/ibMACWba3wyKGVf rsA51wz+XBzOHlv8j60pZmduGSfgm9AhMVHnRM177hrTmBlQ1DhLi/qvvFJHS/dv3LipN dMA0HA7Mwgg8BL98jJ4PhahEvELz+NY3kQhrZuVQKxwoQ2RUFvl5MVW7PIHMkI9MtPVBB EOivl/d9Xkzi+gl60O2kMz70fxyhgpPtYdunedFOxT3ai2jg1mqi5yzM7XJPPXjwCLA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796441326; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:To:Cc:Subject:Date:Message-Id:X-Mailer:MIME-Version: Content-Transfer-Encoding; bh=xWbH0xM/CDPvL//NNaSz4YWXvWBE7h/xyWT0PiKD56k=; b=3iU/zjwp9N/BcnmMUMGG28flv41LkX/Me3T4cK14E6Lz4NWo61bGdJacjGVIskICDPVW eAtrO2Yn1i6l2uHUjal7teABaG7D6yQLH28+5+JTagby/VNKzuKqrae+gcVQZ8sjNZ0wR hNHWzvBXw6cjLMMb+sKYAOpB10Cdl+BvGFWfAr8IDu+7Z1lPgUt9o2QJWHethJNQg7yrF AFQPlxiAjbpMLc6WghV/d32i3UqFuhzz24Ctyti1l+StvUXVZCuvWbTo+u5+mqFuU3+Dv fUvWJLZJi3flDSKZjhOv/YypZ/gH3gN2z3XHt9YVKqWapf0mVpGjq93zLTCnYh6B6Nw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=FtGLAG4W; arc=none smtp.remote-ip=209.85.160.175 Received: from mail-qt1-f175.google.com (mail-qt1-f175.google.com [209.85.160.175]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B4165606A6B4 for ; Sat, 5 Dec 2026 03:28:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org B4165606A6B4 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=FtGLAG4W Received: by mail-qt1-f175.google.com with SMTP id d75a77b69052e-55dc111ae86so11850951cf.1 for ; Fri, 04 Dec 2026 19:28:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796441325; x=1797046125; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=xWbH0xM/CDPvL//NNaSz4YWXvWBE7h/xyWT0PiKD56k=; b=FtGLAG4WioyiPfIQ8PUu8KiJKdR7BrBAf3VCNs05oSh87s68uNpbD9jMzeXeutz+Lv XsLT3z7IKwd06Ew3WRW3eU/r+RX8I5lr+hW7GC8DxIqobaa/U7R/Y8Ati95fvSxJTN2j qRsY3SW6CP2DOWns4o59aqCOBJOjrg2gXaRFcAttDv0lGfejtV73wDgpwaZu6baTTvRd dc+TuAqEnzTD7hunlLVeeqSR8PFWcHbVMJiZYijU3aI8DW+eBM6gMu+60un5jHkBudYs 2JcGwQOxmuNre07t7jdFfc9q5JVykP474OYsZsGIQsc0rXmYiGLwXtqKPzgxbeySHgiA S1jw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796441325; x=1797046125; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=xWbH0xM/CDPvL//NNaSz4YWXvWBE7h/xyWT0PiKD56k=; b=tXKJprwe+GVUX0SVtVEUID9KWZ9LAIaeBlK8M9N7AQgamm4x5uo39a8z+fvp5hToWf rEDba7gGrwdpDRhnrRafZUd2h745Ct4MAVukbW8Z18tzeJYXMmwEGycejmsHYWePFFVt 7DAdoqU0AtDGv9Btpj2x24KdhEa12ImNZo7WgA5oLEoy7J4mJK0KImUsWd+ZWHT5LWi9 KI1ItZzijb2H7OjHfMtVpHgMXs1SBSCJMtYeNOXmQxzqn2+ij58T7YiZj6UW9j9f+9Qx qLEDqndfZyrEpDs44tKi0/foVBhrxOSrih3DdMLEZG2zHIp2GwKcaQRM77J4aP+nvhPe Gv8g== X-Forwarded-Encrypted: i=1; AL+hErG5sKgt7e7OwlBOvCn1XFrX2m4QyCzw4ME3IsAZp+lN7Ri6YOhzwF6wc5yI0sgtgmItZp3zLFm5XgWL1Ek=@vger.kernel.org X-Gm-Message-State: APuU4Z/W10Iahpz6qmPWQSFGreXco8pVu9CHW32+TykB0yxM44u2bkF2 9UHk+hb4oNsosJLnH6H0Ie9kgu0CAslmU2jrSyuUKUfDoYDO3S5zZ9v9 X-Gm-Gg: AZFdTZelLUfDWz3zveCHDCbIcmeZXeoT6ZGHSvp8CZavAIIBv7X5rLWWh04I/xDgTYO KmGb+4dObzhvVGXpzsDl2RJ/+0Zra0CMYBJidHLBjyM0IhlmQ2cFJIqiBjx2qoeWG0OPF+vSwR2 +5Lomzk7QyNcwFHA/74/9c5SLmes2/Q5lueLQvoiR6jYsfDvq57zqaVkLTPAxze84We2O7+7KKD AudIsM3WDH6RH7NjmoyGHhNVqz0Fv+fnmY66mMxreiElCmlDgEecAHClSXnS8mOn+61Rjy70+qN 2+kLhs1hwtw3pPjJxiVyPuAeUiYy5x6h2PKd7X1AWzyXLKV0Hj19K3yS3BZU2xsllha53Ptw1Or 4aB/3m3aYT7bnb4NAwHrsM4P/6WO4kkDkwRFveOZ3cPe8m0/K48v5nVncHQvbtcA6h3v7g15iKd az0fOMt726HhhCl5XnejXbLf8XVdszpd7smHsE4s6zQInL6HNoiNsi2ug/qmywll8xXJ7sBK3jW XeUoWr6BlvQvG7k0lCxYv10KBZ1WxNC0phqDVL3S8gLtIFe0U8YBbxCvX2yTBh+XONAxwZ4Ozap eyQaqoC5Hmh2F3EHi5ToDij7E6g1Mq+rNe7NDGew0RjZ9vHZVqrwpYcTgJzIn1aSY62viU1jakb uU2gw0Cmx7wjHDe1J6yhPEm8bZn1l/yXDxPiVvUYrpOQ8H6TjMf1ixNYwwvM9qcbAqiKF3mFy X-Received: by 2002:a05:622a:a58b:b0:535:2047:6363 with SMTP id d75a77b69052e-55e38598444mr69339681cf.6.1796441324758; Fri, 04 Dec 2026 19:28:44 -0800 (PST) Received: from localhost.localdomain (c-107-3-155-154.hsd1.ca.comcast.net. [107.3.155.154]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-55e366238bcsm36225571cf.6.2026.12.04.19.28.43 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 04 Dec 2026 19:28:44 -0800 (PST) From: Yifan Feng To: Ryusuke Konishi , Viacheslav Dubeyko Cc: Eric Sandeen , linux-nilfs@vger.kernel.org, linux-kernel@vger.kernel.org, Yifan Feng Subject: [PATCH] nilfs2: keep the current mount options on remount Date: Fri, 4 Dec 2026 19:28:40 -0800 Message-Id: <20261205032840.96219-1-evanfengff@gmail.com> X-Mailer: git-send-email 2.39.3 (Apple Git-146) X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit nilfs_init_fs_context() fills every new context with the default options, and nilfs_reconfigure() installs them as they are. So a remount that does not repeat nobarrier, errors=, order=strict and discard resets them: # mount -t nilfs2 -o nobarrier,discard /dev/vda /mnt # findmnt -no OPTIONS /mnt rw,relatime,nobarrier,discard # mount -o remount,noatime /dev/vda /mnt # findmnt -no OPTIONS /mnt rw,noatime mount(8) hides this when it is given the mount point only, because it then passes the current options again. Before the conversion to the mount API a remount changed only the options that it named. For a remount, start from the options in use. Fixes: 36defdd9d7c6 ("nilfs2: convert to use the new mount API") Signed-off-by: Yifan Feng --- On the for-next branch of nilfs2.git. Tested in QEMU with mount(2), mount(8) and fspick()/fsconfig(); with nobarrier the flush requests were counted before and after each remount. Found and written with the help of an AI coding assistant. fs/nilfs2/super.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/fs/nilfs2/super.c b/fs/nilfs2/super.c index ddad1e4f55ce..a4e17d6ee8d7 100644 --- a/fs/nilfs2/super.c +++ b/fs/nilfs2/super.c @@ -1286,12 +1286,18 @@ static const struct fs_context_operations nilfs_context_ops = { static int nilfs_init_fs_context(struct fs_context *fc) { struct nilfs_fs_context *ctx; + struct the_nilfs *nilfs; ctx = kzalloc_obj(*ctx); if (!ctx) return -ENOMEM; - ctx->ns_mount_opt = NILFS_MOUNT_ERRORS_RO | NILFS_MOUNT_BARRIER; + if (fc->purpose == FS_CONTEXT_FOR_RECONFIGURE) { + nilfs = fc->root->d_sb->s_fs_info; + ctx->ns_mount_opt = nilfs->ns_mount_opt; + } else { + ctx->ns_mount_opt = NILFS_MOUNT_ERRORS_RO | NILFS_MOUNT_BARRIER; + } fc->fs_private = ctx; fc->ops = &nilfs_context_ops; base-commit: 499a46e4a0f0ff642d5fe2a53bb04a0de64cfe74 -- 2.39.3 (Apple Git-146)