From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.160.171 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796441326; b=BmizBeyxWyHkxrKkx95mUivwSpUBwagbpYjG+sIyrhRGoiRxcTgXQUZcz8ogOohAze4K FlnExL3NLWY0tUHnTPyHKrc4udJ7ISp63X29U0EhqyjL9RkSfsXP3IQ2WbmbubxmCyAS/ glZkcv2IopYsJM+ImmuF8Vt+t0ZZWqKwe2kWB3IoMFMqpDnWYyxQkcbX4mwHG0E1tpU1z MZ4RwmGyCx4ldKLOW/5irzFkcK4IsJusV0NptbQVRB0ooUiMSl6yB2FXUNkTFlh2X7Xdu Ec/5UltS5qqBr6Uus+CnnXHW6nqNPMtSokuMzG2ZANSOJ5vmaeMPqGwVWfi0hJxr0Pg== 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=HA++kxtEtCnLJW3MVPxETLUC2No2S41x5wPDRXiBz+BZ6uKMX5M7B539M8xMA1hGgjaR YmNXEJaQ4nBdU5ZQj3qdCjuiHCEkBFDFH5rv5DV8MesAaHUKOUcTYIxYI3cXjd2LyWchq H0Oc6vTIIsxu2/y0hTUjtNmKqS9SkbFEFxwk9VyUSYLXZt/KlQDfwRvMwgMWluUHed7kh lTowiN09k7GlJOfrnWlh0U8YmJNjsGZmfjgpiYgtZYGhHf+tWXR07xuA1yWuYDIeE7+OK 6Qfk/X4k5WF0JpHDsz0ZSKWS5tWZTi53m7mhg0LDNowvHb2o4NoOt8nP279jIa8rLCw== 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.171 Received: from mail-qt1-f171.google.com (mail-qt1-f171.google.com [209.85.160.171]) (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 B45F2606D018 for ; Sat, 5 Dec 2026 03:28:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org B45F2606D018 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-f171.google.com with SMTP id d75a77b69052e-5363316fa0cso17987891cf.3 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=rIc9e+7bq5G5JqcG7IRTwU8zPJbGbbh86QAQYZx3snx4SietySkjIzTofqp6AhRW/d zdV93Wl+bb8tcXZW1Pt7PUJpf1baipCuJz7BsEBCS8eqNGQi174gPzWucu6qh5YFfDar MyxWyyXODsu51tT8ug4jDuprt1XF6wzngtQBiFizy9L/hK1t6GZH+OE4TOcQhQSlqsf+ ZhyghzQnTKT+r9NagD61vNgiIGDpa8lzVvnj9BGhZNvzEGdKk3vthYUwN58CKiC7Njb2 hh6Lq+M0Q2VTbQ9dSnfK4kBq2pmTXA5Qcv8suWh48jrk8547tbfx5cBI95AhtNVV1gEC CXtQ== X-Forwarded-Encrypted: i=1; AL+hErEXVDiJ7iUD/tnDJlN2L2qEVQ5hBVs+0CVAZdkZJVTiHMVyd/1INeB7IqdZtU4rmyLMUTBLOWksLca//A==@vger.kernel.org X-Gm-Message-State: APuU4Z/86/kL/FbWbskaCWvgTX/BpC2W6zN69cWEUGpJUwofuiGSA5Zi MP6C9/z/FJXcjWfVQ/NLL0DVq5rNZWfWPaDJF3aqa1KvuAJcINFMRXXImJk+CyDY X-Gm-Gg: AZFdTZcuvZFEHH/5fu1LkbHnWWBd9El0LZCmPAJ2DakP6w7q4UHFYuVOgi3elAEnVTR zg3aeEG8q0ow2xO7eGVYtoSOxEALVFZGriYoIHc9fRXmWj8JhnaxC08/ECL4HwRgyxal9oy6I96 n+QeHP1U8QL1WHW5GNQe18b0SSyryb0LXs1pBnLecvPPluLiJ91p9xKOMuy7HFg1XEpIrplF1c+ z56P8oKxeT/tzUEOk8NhR5+eaCwfk9VDorf7BBlMzXIXzt8Hk/FbDsJHTwIOGd4lwdeohFyDC9j lRxBH8vNIX2rxav8dUbLS4IqXT79jAq0oM4x8k1LdSFYrGAyCZpmK+mGb6/9PvtPac5ZNOBlU5s ++RlLrY21s0DFnyqwn2WaR8U/Fb4xILdgcYfTgDJBlgItqyc/PVc0RkcDF3OlbjRBGLosjGaCKZ dYB/Fq5yq3P87HS5zs/w+4ynlhBZWgpzniOGEaMSdUFliLx1pevTey2y7MU34ogT4/QIspZQTw1 zXixykhSGmfD9LVs+Z1EpCxwI+x59jYzdBSKt9GtxaQ7XQzgtWAvs3+6fWcfQefhF/YZTJcSSSu +71dk0qFa35s892SyRSAMD+fHo6aBsWsDFJtHQ+T3ImyCyepZzTM42fp0vMW55LQcjSLDbhBV8e h4wMxKiw9ExUh6amyXbEDV6h+r+6OgyQpcLmCbsYqWVxYS/RxnH5M5NyUUMzAJKRQLgzphdsA 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-nilfs@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)