Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp951008pxb; Thu, 5 Nov 2020 18:32:41 -0800 (PST) X-Google-Smtp-Source: ABdhPJyqFbdofR0q9UnQ1u5fhRPLBD7S3R3aBfMpgM0kjHMaOs+29rtM9pRMyPAiOHbynxg5/SEK X-Received: by 2002:aa7:d709:: with SMTP id t9mr6015241edq.305.1604629961127; Thu, 05 Nov 2020 18:32:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604629961; cv=none; d=google.com; s=arc-20160816; b=U+RU02L+jKVu58z/odEfSCgZ7TVhNT3krE0qUnSKVoQH5+eOzA+HQk/xYvrkKac31G D+Z4fksFln/sjeioAMq+CevYKnqbCI2y2CJ4//UsSx0lUkJN+x+vTCeqvLbF6zba9Uw3 8Gc3hMBUVKvDPXd6BeWU35oRc3Dd6B/wf6ASSndgsGGarDs8Q1celYNvGVpRbiKOlYlw 1vLuXnRsxgZ8PJOPljhe1p03ZpeZ1X9p8eQEeX1wsFooarMZ6GgryW273SaZEOOnn5sd ohrCbSgR2nGlwAzADlRLrPncFmlv57ueKCwkT/YkLsLBIjCBJQ8DDza0Yrvdugb0gm+8 75Dw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=tsr7cdpGUOyfncDn/h61HXJdx4RTLtu0m6D9FTAP3uk=; b=qIeao8l0C3OjUODJcg7nIonvivpx0A1ZECFel1e1IaDTmevRl9/25ZPO0htHWIGVb2 waMjkck9C5cOEA5KzMES3lEaY1h9WLhqZnVvQh2717LymHNm6lSk5smQD+F55GAMJKnz aEA+M2FT/svMWZblsOUeNLIEOyjG0276B8qI9VZ5IYK39K98Hz+rtnMVfv5GzpzEf+F0 7Y2ayXcvi+lOOt+FzvxN3KxxOoE1IJgla5gWjYdspKnb3OKNeVm80/zF4jN9ASNf4flT S0PeTkGb5uHGm9AHs29pQXLzFyTf3LbKAp/AatvfJr//xbp51+rj8Dt/MsOAHDZxA+3H rq9A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r15si2689556ejy.36.2020.11.05.18.32.18; Thu, 05 Nov 2020 18:32:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725897AbgKFCaR (ORCPT + 99 others); Thu, 5 Nov 2020 21:30:17 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:7150 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725828AbgKFCaQ (ORCPT ); Thu, 5 Nov 2020 21:30:16 -0500 Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4CS49W43j6z15Rm5; Fri, 6 Nov 2020 10:30:07 +0800 (CST) Received: from DESKTOP-FKFNUOQ.china.huawei.com (10.67.101.50) by DGGEMS403-HUB.china.huawei.com (10.3.19.203) with Microsoft SMTP Server id 14.3.487.0; Fri, 6 Nov 2020 10:30:02 +0800 From: Zhe Li To: , , , CC: , , , , Subject: Re: [PATCH 1/2] jffs2: fix ignoring mounting options problem during remounting Date: Fri, 6 Nov 2020 10:30:02 +0800 Message-ID: <20201106023002.12752-1-lizhe67@huawei.com> X-Mailer: git-send-email 2.21.0.windows.1 In-Reply-To: <20201014065443.18512-1-lizhe67@huawei.com> References: <20201014065443.18512-1-lizhe67@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.67.101.50] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Maintainer ping? Zhe On Tue, 13 Oct 2020 15:22:37 +0800, Zhe Li wrote: > >The jffs2 mount options will be ignored when remounting jffs2. >It can be easily reproduced with the steps listed below. >1. mount -t jffs2 -o compr=none /dev/mtdblockx /mnt >2. mount -o remount compr=zlib /mnt > >Since ec10a24f10c8, the option parsing happens before fill_super and >then pass fc, which contains the options parsing results, to function >jffs2_reconfigure during remounting. But function jffs2_reconfigure do >not update c->mount_opts. > >This patch add a function jffs2_update_mount_opts to fix this problem. > >By the way, I notice that tmpfs use the same way to update remounting >options. If it is necessary to unify them? > >Signed-off-by: lizhe >--- > fs/jffs2/super.c | 17 +++++++++++++++++ > 1 file changed, 17 insertions(+) > >diff --git a/fs/jffs2/super.c b/fs/jffs2/super.c >index 05d7878dfad1..4fd297bdf0f3 100644 >--- a/fs/jffs2/super.c >+++ b/fs/jffs2/super.c >@@ -215,11 +215,28 @@ static int jffs2_parse_param(struct fs_context *fc, struct fs_parameter *param) > return 0; > } > >+static inline void jffs2_update_mount_opts(struct fs_context *fc) >+{ >+ struct jffs2_sb_info *new_c = fc->s_fs_info; >+ struct jffs2_sb_info *c = JFFS2_SB_INFO(fc->root->d_sb); >+ >+ mutex_lock(&c->alloc_sem); >+ if (new_c->mount_opts.override_compr) { >+ c->mount_opts.override_compr = new_c->mount_opts.override_compr; >+ c->mount_opts.compr = new_c->mount_opts.compr; >+ } >+ if (new_c->mount_opts.rp_size) >+ c->mount_opts.rp_size = new_c->mount_opts.rp_size; >+ mutex_unlock(&c->alloc_sem); >+} >+ > static int jffs2_reconfigure(struct fs_context *fc) > { > struct super_block *sb = fc->root->d_sb; > > sync_filesystem(sb); >+ jffs2_update_mount_opts(fc); >+ > return jffs2_do_remount_fs(sb, fc); > } > >-- >2.12.3 >