From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.222.170 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796438163; b=CLn6UMkt2e2sgihB5o+nNOpFGcqbYJalR31N5+ruED9ZtVWWgi+sBctHl6Mxk8tQvnFK bvKy7OUsMCeDjv+6KofsA0xsWyBwUoRLNUKn1jfjkgFwUSCGD6QthowFRrcJc+CWjTyCt Q7bcVii1djPOh/HtmHzIB9Qk3JJmvlwT3SQYR2henCLAUYr06YR/gEKNumjkAT+J0Pu8L sjGLPPYxWTEISvPc9h/5Q3aTH3JsxDiWBffFXG+Pq6kJIXZxads/6JYkVrhgqgt7+Wvvo UhZUOGp9Zhr7NaEAV6/kzGl0IZBig3lxAhhd1SHVEneMa6cz83bJBFtKenTP8v/Ytgg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796438163; 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=4bsAAEmcYd+oRsWRiocUwSX3FCxFukMzxI0wNa6IjK4=; b=VEAMp0C/PITP+u28TX/sJJ/WRVR58cMikzRQl9zWrUg+PT/dv9KoT2N6V24/wZV2NPjI chlplcp5SpUkuaEc8lkfabN2m/JQz1X1jI4wp4aHUl2JtpOVGptrZg6YE4zNIw+wrqVd5 r4bd2C5piB9eG0diJeN/hUhRmU+bxFd6GJLs0nNg9IEkb6gvedkSxopC/e7qDcEksF2Vh 8BMYJTdYAGnD5N17q7p1fYS46FoTr0rZRli8twM6xmZWo/ZIPkkLUKmImR70B3kYaBHep 9phPfoskx4fc5+9ca6GBafU3UlI4yChqmrY6dsW8Dd/sAbEqF68NWz+SZHpc8675hEw== 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=nqpVyCxi; arc=none smtp.remote-ip=209.85.222.170 Received: from mail-qk1-f170.google.com (mail-qk1-f170.google.com [209.85.222.170]) (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 5F3E5606A322 for ; Sat, 5 Dec 2026 02:36:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 5F3E5606A322 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=nqpVyCxi Received: by mail-qk1-f170.google.com with SMTP id af79cd13be357-9495d543b91so97811085a.0 for ; Fri, 04 Dec 2026 18:36:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796438162; x=1797042962; 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=4bsAAEmcYd+oRsWRiocUwSX3FCxFukMzxI0wNa6IjK4=; b=nqpVyCxic8E8JkyTLrGdzIwA+T1GVgbECAD9wEfpeDzD15N3Us4wXLTgLg0kAZX6wy 5IaALLUwnXhqvvrKQKHB6nv1rSkxqw88W4f1A8ZJsN2QwAyFL1ujCJCSrXCJjvo4uGjv Brh5AyE1b61evenXjFfNk1U2FEuysT/7blXdz2EM4jj6AwiJemkwMiDENTFslbceyD1m lhlR9pe1x/rq8pwOSosl22Kl4ueetxW0MBHa+s46aJdD40yXo6nZfIlHpU8Qv/IwFq8b RHbxsLEFydaY2y9Wyo+TZD4B7L2QRQr4vBQ6r/ljE255yo8tcC0hC3DN/DTASupiubaB lONw== 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=UrEOgAmcQcjtIq4t6LcKmcN3VcEVozeBFlz4mU/0cyERLRwLc8zqi2bipnZ9Jje9Cb VvE4RLE0P+f1N163PpRhxphXjLJ8caC+uleijXVfEHFmkY9jeDL8ZzwlCg087QBF6rHm oSMLDlpledgwK6wWebwScwri7QnESIa8IdKM0raDleMLGnvQc6s4P+zs5UO69FSYa9oa Vh3CkQ6DFsfBwKoBH9XR7nP1stGU/2/XP3Ay8w0FMWW6shnFN/f4hxX28QuBhy7rHPTy gT3gYibmvyAvkwMdbhHPSsI3cjDLSbTheOz4zhYHpIeV3Sslb/Qm7Vabnr8QUp7dRxLr S5ig== X-Forwarded-Encrypted: i=1; AL+hErH3RlqtbMrK1WKuW9jePwmQKL8HzGgEsrIuthY23OWEfSRi3YmxbyPcm4FnhynuBagkc3I4uFWESmw+PkQ=@vger.kernel.org X-Gm-Message-State: APuU4Z+LRtJDquw9LLn0O2W59wVBKu0rvXNjBl4rofaiSlzKp58wJsDn cjHVAQ95ofUOJRzgdszWyfjtHGhkkuZzFt2ZariPe+hjt9wiRA3v+oBJ X-Gm-Gg: AZFdTZcgBdqQcKaIWJzcifqrImRkhaiiDqKHSwxNThiyHLHa7QThL+z45XH4q63uRxX kVuRgNV1YCl/VIamQj7YB0syEryve8MKBQwchBRNvWt2hQO1XewXHKHKqKVs4wpgYKNsgOMZLBm tDoz1n747h1DMLpd0EaKto8+0geNz6v57X62JEZh5h9qUY1lk2XtW+5wrUk9A6F2uFKhjgP5PvD zUUDiwtE5Vab8rzJv57tNca08gfEjzQUqOcPQFa0xk+YXqbt+LuMA8shmAq9KJsqmvnXe0sSYvW VqwUMn9nhW8mDI6y+SFYX14xi6GBRsNThePuQez1yxDx/YnidfMMVl+lvVH+HbXxuP6wc07gwPz xIJmbOcaCWTQt/atXZQCVLxX74g7EyBzEYSloE0WogxwAD7uCTbXKWdw3JepQ49BUKhe1GlkJ8P jmcpHNmdsKA5ZoprLtujjvV7iI9gcD4W/F7VOSP8UHL9BlUNu5/Szo8dH6BgksLzC4HC70B80tb pkYg97QPSDJsjGirV9L/cHjpC1j48JqaOF6RcvrcV1Z25IYE0qMJRn+uGhMmbtwjTAcWteGInOZ ECZv7XG1IYiMn7ph4jHEu3Eos4SfAC+uqQhA0uBECUooV86zTjV0Wv8D5rUOQgKlEiK+uMV0x3O OOO2z2e1NQR0EMmtXbf21mbn5sw1jA5Bs1a+q1CAXjza8bWl/Cz9lYHrHwFSVF1EpoTo0lsN9 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-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 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)