From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 25CBC606A322 for ; Sat, 5 Dec 2026 02:36:10 +0000 (UTC) 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=dqU3BJia Received: from boromir.ozlabs.org (localhost [127.0.0.1]) by lists.ozlabs.org (Postfix) with ESMTP id 4jhCCr1QgBz2xmV; Sat, 05 Dec 2026 13:36:08 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; arc=none smtp.remote-ip="2607:f8b0:4864:20::72b" ARC-Seal: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1796438168; cv=none; b=QbW5ZfPY1LgiVBuqmiugr0Zw+Gagrye2H17ODWq6EGrCMVBtCjZf0fkmeOcj6cyiHEvXmDZxh8v7seJCUOqbStbIoiG/eZvu7BqBI+/MMGajF+IyIuZ7nAehU6uQjimsq6qvFgPS2WxZn4ULwHNKopqeG9L2nr9oBWkiqjDK/7z5EMgsqHMVP6bL7WHBiYt8O5bSyO8MaKzMJdxVK5tx8FIJeq/2axxH81Myq+ZwUNDFHmqnhu9NihYe0DwViIdViqJ48QHgXInihFv3DPlKyeDPKsBhFR6shDJG4FR5HUYjnzagdoppBnurTKDEky65SnB1+fVrlP3YgXx9lW23uA== ARC-Message-Signature: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1796438168; c=relaxed/relaxed; bh=4bsAAEmcYd+oRsWRiocUwSX3FCxFukMzxI0wNa6IjK4=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=cPYgNghg5MLaOBXt9+re/g34IE+uM+ppw00o0Gc0KlvRV1PdlvuO0ZmyT3MBZ9I3dpSohjFVyrEn6pOn9vmXs/H4clmaNludZrWssXonSgKfleaklWgGEckw4QMggkXPCos7AekCugsE2vAG6qEqscyxmD/0LHpb5uWR+yDspIGxw6YyTdjb/21C3qLn7H8DN0wnaoRZi993VbKqaOSOf1uqr+Wr8gkunhQ60dwKTWig0EYKN5iWyYLEmbUp1DcLyEGpsInXvlA9vA50bZrelMwsnflfzFTlxIHn8pZED19qGjmMKIqnzYR2VytbTQgwgDDraHQY3giZqzrn/cm2Gg== ARC-Authentication-Results: i=1; lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=dqU3BJia; dkim-atps=neutral; spf=pass (client-ip=2607:f8b0:4864:20::72b; helo=mail-qk1-x72b.google.com; envelope-from=evanfengff@gmail.com; receiver=lists.ozlabs.org) smtp.mailfrom=gmail.com Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=dqU3BJia; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:4864:20::72b; helo=mail-qk1-x72b.google.com; envelope-from=evanfengff@gmail.com; receiver=lists.ozlabs.org) Received: from mail-qk1-x72b.google.com (mail-qk1-x72b.google.com [IPv6:2607:f8b0:4864:20::72b]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4jhCCp2w61z2xKx for ; Sat, 05 Dec 2026 13:36:05 +1100 (AEDT) Received: by mail-qk1-x72b.google.com with SMTP id af79cd13be357-94961bfe1a0so102143885a.3 for ; Fri, 04 Dec 2026 18:36:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796438162; x=1797042962; darn=lists.ozlabs.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=4bsAAEmcYd+oRsWRiocUwSX3FCxFukMzxI0wNa6IjK4=; b=dqU3BJiaG5LZoGdNlA4wvGV1b3oPFMyJanZvv1kIVsOe6bPDMbuPjk1iFPsTfVm+RJ o443T37M3ETDPAxQi4KAIsuODaQHbXwQ3Y78aFK81yNFLHHKVA3bmmfffEybdbSRBVp6 82C6h3SA4XnvqOE4UNHUMmOXb9OSh9cW4OTDHLeAx2zVFnDIaGpV9jMNPbG5w8/Ar+cB VIzvs6EyQM3YjeFRN/YKn243Ss64i2tzOc8xx+aactYo9wpNnw9gHxXVW3srPAcZ0h9E 5tkHmI3BT7zmCwlSPfza9tQ0SgU51sVqUQHDABqBtmiGEk/OudQOAbHcddhoGTdqAVG7 UhxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796438162; x=1797042962; 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=4bsAAEmcYd+oRsWRiocUwSX3FCxFukMzxI0wNa6IjK4=; b=Q/bAzAWcnkSEKQo9pwgmVui3eFvM2epEI18VSpUQ0W5RvPA5qgGS+/KWWHDMrUbB8R RioTo4a8epNg6n2tX+/TKSm/Tca8TsmP2OW41WfbxqyoNejRTBj19uxC0N98h3u41g4y aVmFb5gxSMzh3B4YgOSq+8n8T2+PptROFreSDT/9PsQvp/2nXMseE04MR+ec1WE3g1G6 obTB1QhkIoFy2/7P/zFjq/Kt8nTbyOT+rgglJwkjCEwzQGcXaaSThfYdwVHhWiPh7EnF /P/kSDwdQZyl8BjicUcAMJN5xz8zdFImKz29puGvbxMiWTkHxtgDEYKJgrHSmU4dAGFf EHaw== X-Forwarded-Encrypted: i=1; AL+hErHdeVpRhCxqd7OPwKh3bkBrxpdU3pIMz9qNKWf02BG402/IKu4oaq71hrgPGcpty3USriR3QIx8lZ9U2A==@lists.ozlabs.org X-Gm-Message-State: APuU4Z8UhxDUhlSO7XUUT8Q8BoVXMgCFhX3ZZtuMTAxC09XDE4C24lWv qmGsnFjvd4y7UNbq8HobzAUdz4QtEshCQZcw77P4lOVvgcW3h3NAN+8N X-Gm-Gg: AZFdTZezYoyd6cwTaC0KTNRcpdFN4f1NMwJiI3H+lM16pr6wq//glN4CU26Noko+wIY K1pYmVELbzH+xvOw6e3FMpNCmtubbeMR9QlKlpmwfuluQDfQ78iwnJ54KanvexozKut37OI4oRZ SjUom6KzVypvFdRc459V92tV1TwHyjTOwCKOc/4Q6xoo7Y1I5W8vELSYUmN+pmE09scoNBP89qK 1c0CS/dV/abqpgyTccdpaP25vZ+Cre7Mk6kggdDjFNBxPytiAUtn+uknr21gQGX1U0gd+blolOa ++9Iiaqjk8QvFk/HmVL78QohnYqqjPIBIr4Z5JmwU81wrOyZSzhTuMhr5OCgrpqAAPEsGy3o/N3 W9PjMCAl+gXGVHju8pRvLt5kZaUD4pov1p2Gej2R57iVRqVPOMblnJYC4AkBiB3eUQagjxpztPa FUu7zJbKUwzc9Tj11b/3hhgNi7M1JgIBDR2fbwEUiIQzZLVsHXWbIEu65YdJ0QOkFMs90iysgdW 1u8hC1qTaMv4D3cImxvcAfbGVcWA+mBabl3oxpnYKQf8lTwb91gy5/DtEWsmE9W0TFbkeG1Hz7K ndjT6rwA/54nbHn+B7CVui+4mzMnmH7qUfa/q1Z2EIpW+RVhIGekKUovmDUcyIXDnCDr+Eg8rrA POY4IuvWWjIiaw6XY8F7ucC7UWFehleMfkMCODJ7x1aGd1f6TkDPTodo+DsNlINxDsRTKv5vb X-Received: by 2002:a05:620a:2607:b0:93e:78b7:fa4e with SMTP id af79cd13be357-94a827d84c2mr614109285a.37.1796438162244; Fri, 04 Dec 2026 18:36:02 -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 af79cd13be357-94a7f4f04c7sm371787985a.31.2026.12.04.18.36.00 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 04 Dec 2026 18:36:01 -0800 (PST) From: Yifan Feng To: Gao Xiang , Chao Yu Cc: Yue Hu , Jingbo Xu , Sandeep Dhavale , Hongbo Li , Chunhai Guo , linux-erofs@lists.ozlabs.org, linux-kernel@vger.kernel.org, Yifan Feng Subject: [PATCH] erofs: keep the current mount options on remount Date: Fri, 4 Dec 2026 18:35:57 -0800 Message-Id: <20261205023557.74104-1-evanfengff@gmail.com> X-Mailer: git-send-email 2.39.3 (Apple Git-146) X-Mailing-List: linux-erofs@lists.ozlabs.org List-Id: List-Help: List-Owner: List-Post: List-Subscribe: , , Precedence: list X-Archived-By: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-16.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_PASS,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 erofs_init_fs_context() fills every new context with the default options, and erofs_fc_reconfigure() installs them as they are. So a remount that does not repeat nouser_xattr, noacl, cache_strategy= and the other options kept in struct erofs_mount_opts resets them, and the user xattrs that nouser_xattr hid can be read again: # mount -t erofs -o nouser_xattr,cache_strategy=disabled /dev/vda /mnt # findmnt -no OPTIONS /mnt ro,relatime,nouser_xattr,acl,cache_strategy=disabled # mount -o remount,noatime /dev/vda /mnt # findmnt -no OPTIONS /mnt ro,noatime,user_xattr,acl,cache_strategy=readaround 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: f57a3fe44995 ("erofs: convert to use the new mount fs_context api") Signed-off-by: Yifan Feng --- On the fixes branch of erofs.git. Tested in QEMU with mount(2), mount(8) and fspick()/fsconfig(), on a compressed image and on a file-backed mount. Found and written with the help of an AI coding assistant. fs/erofs/super.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fs/erofs/super.c b/fs/erofs/super.c index 01439e748617..80e8e49bbcb5 100644 --- a/fs/erofs/super.c +++ b/fs/erofs/super.c @@ -999,7 +999,10 @@ static int erofs_init_fs_context(struct fs_context *fc) idr_init(&sbi->devs->tree); init_rwsem(&sbi->devs->rwsem); - erofs_default_options(sbi); + if (fc->purpose == FS_CONTEXT_FOR_RECONFIGURE) + sbi->opt = EROFS_SB(fc->root->d_sb)->opt; + else + erofs_default_options(sbi); fc->ops = &erofs_context_ops; return 0; } base-commit: bb6713757f26cb11a12723b7a8ae0ec6e7200eeb -- 2.39.3 (Apple Git-146)