Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3120671pxk; Mon, 21 Sep 2020 05:55:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyKOEBJEDt4P89muTiFxGy9lFiSPBAvxstT3kPAVZvhX8QEzXe5CtoUlFqkF2gNd6PF6axK X-Received: by 2002:a17:906:6a54:: with SMTP id n20mr51317195ejs.401.1600692902626; Mon, 21 Sep 2020 05:55:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600692902; cv=none; d=google.com; s=arc-20160816; b=aAV9c+9sC5v973g8hzfS8G+dCklyU/KxaPXB7ZxIqmxEbWq9mGWb6ch4kqb1qebya+ Yu34kgmU5bAXRZHhtF9CCMEKFMNRATFWKOFe3pQHpG8+w6FZ2e85owkjsR7SVC0bvtEO yG4dIW75jeidci4Cnn52i8H6YXhrgMf14g+VvA5N76k6V2BAsCh7Qj3oLBhE5X+Rg/OK tlo+YfAc3iqVJ0NXd9Rl6mkBiIDV4Hk873Z7k4460CEA33cvnh+0hoSu93YeiSDKrITw QAHCCpC2+gT4MQWNOFpB2UfufuzeEXoM48PrjTEV31GL7w+zrX7gkSiA2PkicR1PJ8Eb q2lA== 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=MzNTOvlf+30H5pLhLFB6Gaoj5USaz1iiljnLODnVQ5w=; b=KxpQsHqVxty9kOcf36uphkAyXfTyxaSAm+PTlKa3ICMmFS3s8D7Gzpo6j35/+mhi9x iWV+R2yujGPcUnMTMdVfeIeuFRTDEe2smdRdMSSD54NrcL5w4cHDgBNMHYhX7uL1VtpA zHA6f+k3IiZ1GnoTvHu+QNJnltg8U1LwE20jie8bopMCterIbEzBe+r2rsfo0OwyKBvb qkRW7Qf3KVJjR0QANF07NIcnz4HgdboXTJNF+TlwZ8iUPLIhbXF03yGi92k6xyNSMikC l16xegx9GwiIVxGo6Bea+lsOS3QPvb1uPbYd99EbG0+0HncTnYiHfE5jISVAInCSNRQ3 mo1A== 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 b10si8332809edq.484.2020.09.21.05.54.38; Mon, 21 Sep 2020 05:55:02 -0700 (PDT) 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 S1726689AbgIUMxc (ORCPT + 99 others); Mon, 21 Sep 2020 08:53:32 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:13798 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726395AbgIUMxc (ORCPT ); Mon, 21 Sep 2020 08:53:32 -0400 Received: from DGGEMS412-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 70A2CC5B7ED38BAEA8BE; Mon, 21 Sep 2020 20:53:29 +0800 (CST) Received: from szvp000203569.huawei.com (10.120.216.130) by DGGEMS412-HUB.china.huawei.com (10.3.19.212) with Microsoft SMTP Server id 14.3.487.0; Mon, 21 Sep 2020 20:53:21 +0800 From: Chao Yu To: CC: , , , Chao Yu Subject: [PATCH 2/2] f2fs: relocate blkzoned feature check Date: Mon, 21 Sep 2020 20:53:14 +0800 Message-ID: <20200921125314.99297-2-yuchao0@huawei.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200921125314.99297-1-yuchao0@huawei.com> References: <20200921125314.99297-1-yuchao0@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.120.216.130] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Relocate blkzoned feature check into parse_options() like other feature check. Signed-off-by: Chao Yu --- fs/f2fs/super.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index e0423b091b30..dc3edc9a5640 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -970,6 +970,17 @@ static int parse_options(struct super_block *sb, char *options, bool is_remount) return -EINVAL; } #endif + /* + * The BLKZONED feature indicates that the drive was formatted with + * zone alignment optimization. This is optional for host-aware + * devices, but mandatory for host-managed zoned block devices. + */ +#ifndef CONFIG_BLK_DEV_ZONED + if (f2fs_sb_has_blkzoned(sbi)) { + f2fs_err(sbi, "Zoned block device support is not enabled"); + return -EINVAL; + } +#endif if (F2FS_IO_SIZE_BITS(sbi) && !f2fs_lfs_mode(sbi)) { f2fs_err(sbi, "Should set mode=lfs with %uKB-sized IO", @@ -3494,18 +3505,6 @@ static int f2fs_fill_super(struct super_block *sb, void *data, int silent) sbi->s_chksum_seed = f2fs_chksum(sbi, ~0, raw_super->uuid, sizeof(raw_super->uuid)); - /* - * The BLKZONED feature indicates that the drive was formatted with - * zone alignment optimization. This is optional for host-aware - * devices, but mandatory for host-managed zoned block devices. - */ -#ifndef CONFIG_BLK_DEV_ZONED - if (f2fs_sb_has_blkzoned(sbi)) { - f2fs_err(sbi, "Zoned block device support is not enabled"); - err = -EOPNOTSUPP; - goto free_sb_buf; - } -#endif default_options(sbi); /* parse mount options */ options = kstrdup((const char *)data, GFP_KERNEL); -- 2.26.2