From patchwork Fri Oct 28 08:45:01 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Damien Le Moal X-Patchwork-Id: 9401591 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 82FF4605EE for ; Fri, 28 Oct 2016 08:46:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7AD302A66D for ; Fri, 28 Oct 2016 08:46:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6F7732A66F; Fri, 28 Oct 2016 08:46:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 171FC2A66E for ; Fri, 28 Oct 2016 08:46:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758204AbcJ1Iqp (ORCPT ); Fri, 28 Oct 2016 04:46:45 -0400 Received: from esa2.hgst.iphmx.com ([68.232.143.124]:55263 "EHLO esa2.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756035AbcJ1Iqc (ORCPT ); Fri, 28 Oct 2016 04:46:32 -0400 X-IronPort-AV: E=Sophos;i="5.31,557,1473091200"; d="scan'";a="25250679" Received: from mail-bl2nam02lp0084.outbound.protection.outlook.com (HELO NAM02-BL2-obe.outbound.protection.outlook.com) ([207.46.163.84]) by ob1.hgst.iphmx.com with ESMTP; 28 Oct 2016 16:46:31 +0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sharedspace.onmicrosoft.com; s=selector1-wdc-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=Eh49Zdh2nO9khLgGz1uZzxCZaVW+crTHx+yRLYywUq4=; b=Zu2CscacN8BJieU2mVN0mdMTl6UlSBENK54pAYRFtVKCuFrtAjlzOXeRc32KDAQIPPIchDExXcoi+VNXwfg9jpv6RHZbMQmo8rzIbqyqzNMt3ezDM9WOzeHaT7IL0Z79rMySliB0izmjI0407nWJxM1zrwaFTIx0NKVuB07Cunk= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Damien.LeMoal@wdc.com; Received: from washi.fujisawa.hgst.com (199.255.47.8) by BY2PR04MB1974.namprd04.prod.outlook.com (10.166.111.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.693.12; Fri, 28 Oct 2016 08:46:27 +0000 From: Damien Le Moal To: , CC: , , Hannes Reinecke , Shaun Tancheff , Damien Le Moal Subject: [PATCH v2 3/9] f2fs: Check zoned block feature for host-managed zoned block devices Date: Fri, 28 Oct 2016 17:45:01 +0900 Message-ID: <1477644307-30115-4-git-send-email-damien.lemoal@wdc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1477644307-30115-1-git-send-email-damien.lemoal@wdc.com> References: <1477644307-30115-1-git-send-email-damien.lemoal@wdc.com> MIME-Version: 1.0 X-Originating-IP: [199.255.47.8] X-ClientProxiedBy: CY1PR19CA0030.namprd19.prod.outlook.com (10.162.38.168) To BY2PR04MB1974.namprd04.prod.outlook.com (10.166.111.14) X-MS-Office365-Filtering-Correlation-Id: 9333af23-7d90-4935-1691-08d3ff0ee8b2 X-Microsoft-Exchange-Diagnostics: 1; BY2PR04MB1974; 2:oxZVEvM17DL4+pG1CxqCZs6ziVMTLTkMXNJH6u3bYxsX8dfyAnePbpuHLq6Jouk4HNfa8DMGd1G1Q95z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iJMF72pdhkW9FieRj5LXqtjyzIEAIROBSZjr7EDecrgwMeutCRC17npH+vQZ4gA4o+OTmX9phsPK/+CdYztSCG61iodCafPRTX0CeJAHEGCsHS4MEQ9DTAq2J+0i0+dc0FqKx8I4iqPSmnTuU5NBYRcZAc923wGUTIuVeZaRCVVi7GnYDk4+Loz/Y2DeZO1zCo/6qhotyYIqu9+nqJaK4dtxZxPptrRWNbZmHxDBiMrV4NZB0oWHPjg/zsC3Qn6CAiacqgtQDYck7PKwZx90KUfdJ4ee/J+8l3q07YBPFs3rFXPoaTcz36X/J5SJDBRtizxfS213G5PWePvpW6rb0TduHpvPE+X2Z3w+rED0g+FQq804f0LkopKLedmL4hMHVM5QaUfqWZzUKIzuGg6oROSuIwH3H2Wv3iyLiJXhWj0yLlBq9L2FgvGeNU5n50yAJooDnR45mLOGb7wJT6lY8KQCSb98cpK56wySIaoHuygwP6yvsdzvagi/2PimXcd X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040176)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6055026); SRVR:BY2PR04MB1974; BCL:0; PCL:0; RULEID:; SRVR:BY2PR04MB1974; X-Microsoft-Exchange-Diagnostics: 1; BY2PR04MB1974; 4:XzI3wMYh+lAQIK/g+pNvi+hLV9rKmizQ4385o9zPIHtuIV4HVYhv2yjCrqi7UnqdbnTx5MxNUQtwG9e9NJqTVKz6fNKhz4WI/mKz7lmPI94LkLA8Sn6Benqckg0uWnkQpitqgwJAckkt+6eU8lRjz1WJQmKf5yvWWZdpYCitk75DFmXzZUxeDJhW+VJWVmVZ8y9rQ7sj520vS+h/yu+gH53ZgSFAl7khgmpHAzrevvtOdSDEr+cH2h88sun7sgpw6PBLtIQWBQ7Td0oTmV+KQSbU3ND0wcgWY0GQH4/Lgp/W5Aoyaq3NbqE2WTBdEuKn94ijHPhqLq+QANUSwctJc3q5SQf4Wa4RHFBy41V6XfevZP1uuOLad3flaVFKub+b3BHWzzvfXcYTqYzznuU2TIBwd0fyeAm/OQmQ9fks2Ss= X-Forefront-PRVS: 0109D382B0 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(979002)(6009001)(7916002)(189002)(199003)(76176999)(2950100002)(50986999)(305945005)(42186005)(7846002)(6666003)(4326007)(86362001)(7736002)(5660300001)(106356001)(81166006)(81156014)(66066001)(47776003)(68736007)(48376002)(105586002)(8676002)(50466002)(5003940100001)(229853001)(92566002)(50226002)(101416001)(33646002)(19580405001)(586003)(6116002)(19580395003)(3846002)(36756003)(77096005)(189998001)(5001770100001)(2906002)(97736004)(7099028)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1102; SCL:1; SRVR:BY2PR04MB1974; H:washi.fujisawa.hgst.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: wdc.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY2PR04MB1974; 23:T6rwfyj76gnMwTRTIhHaapD8YYlQEnhywessoleHk?= =?us-ascii?Q?xdq4IhHZGvf0aiurXfAgvl9PiMmyaymDt+Yu5iHYh4jPdIYD0frcvpfOI1iR?= =?us-ascii?Q?fMh2C9ZluMsGeqR+d5ry6SoyBbH2Gr/dTtzfRo50YiNGdBoS90F36Mvb69cO?= =?us-ascii?Q?FnEpeonYFrkmH3YYc1Akjdtf7CKa9yAkRKG9Z+hHDCwZITuP8/fYL05zBn8f?= =?us-ascii?Q?RTuaWwalCdgoJ5lDHoHu8FnvD4g305C6dfhw3vfIdCk8vo5KlPndTgqy2MlA?= =?us-ascii?Q?UhFYyqrkVoRGWGf2ozuBz7/0kdWISl7sgQgf2FsHPcWPAHV8ywz8fgM/Xnmy?= =?us-ascii?Q?cSTKOmvdbV0Qj00+a5stmAQo/bJAapUeNzS3CAFVH8w2Q7BahYMlv9Pi9Z7Z?= =?us-ascii?Q?itZcW+4tSWKicrvoYs2yMQUt/Vbus8T1HG9eBJaC42U6oojitQtYgkNG/g9G?= =?us-ascii?Q?qd8Vd7YOmN5B4VHv7kpO/KSLypcDekvafNIBtrzZYJbrtw9QA4u5IuFGi246?= =?us-ascii?Q?H2iZqNju5l7HntJcv7pPWQwE9g0fVWYk57g7aF6nVnD0GlCbQZfy+C68deWU?= =?us-ascii?Q?GPtJWm5+dFxWMBp1839bA0kdP0oQBPjPOKgUAu5DbOXd3mKmbHKGVuxf741s?= =?us-ascii?Q?9hxJMk/02UyKEcSeOWEiUnY64XQhx7fU3qGIQZxlKfVGgQe/gV4zTspymkde?= =?us-ascii?Q?Y+ZxAJmfXHWvynehq6nHOy07fhADfBUHD6cVDGe95WBorn83+8DMexP5fCyC?= =?us-ascii?Q?zPWe0+8O/sDw912iwwK7sni44w3Kr3hk6jdC6G9Uw5t2c8Z/uiOriqVGYKVG?= =?us-ascii?Q?OQQkZCi1DC0FhKqg21WSKPSjYcuO61RUk1sSFAoaERrW8iKF3HVGG5gmqLDh?= =?us-ascii?Q?q6LmxDK1+zBB+2KuqO7/XodkbBh2PmvgbR6yi3J8GBXFm9U6CwZdbA4AB+kW?= =?us-ascii?Q?5o4kEu4COn2DlDWUInMsRMwswaXve/WFhyoatXP1FCeQRU9NgOqk9Uiqp23v?= =?us-ascii?Q?DuD5tpUqgx+Ufyy6KuAFUx/yYhg+h7//qvPQlCX+nuPqrcuxYrtgaeqk7XK4?= =?us-ascii?Q?fqD2GClWaXlwoH4EfKo8pf6UyEHvICH7B8vLRMV2fQ6/9xW4JRXvPUJBzWm/?= =?us-ascii?Q?tpOvm2mL6pRGSXda29N8Nqd7BP4GhwqZTP5esR0xedoeU0qp62N2iwG3LgjJ?= =?us-ascii?Q?WaQ+RYXTqauOiE=3D?= X-Microsoft-Exchange-Diagnostics: 1; BY2PR04MB1974; 6:Kd6xeOa2TaQor3pRs6jvsFeFbMKqBDh/u7p+6gBOSXZ9lGean2seHAvap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M5i1T1FVy7jQ+hzq0CUzw8nYIOmIuyEI4VJZ2ANeyykIpTtdPq8ZHo6K7/eYsclPIeRYM9+Wqpk02h8zMBD/Sdfxx84kYqi6a94xsm/ziZNGke/+yLGJvppZLeveOOJaDjAzJbw3mvk+hWUYQtleMOv5ZitNMGtQUpFc/P4fb2+T1JhH/0miFi08ml X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Oct 2016 08:46:27.3270 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR04MB1974 Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The F2FS_FEATURE_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. So check that the feature is set in this latter case. Signed-off-by: Damien Le Moal --- fs/f2fs/super.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index a83df29..c6e9b94 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -1642,6 +1642,26 @@ static int f2fs_fill_super(struct super_block *sb, void *data, int silent) sb->s_fs_info = sbi; sbi->raw_super = raw_super; + /* + * 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_mounted_blkzoned(sb)) { + f2fs_msg(sb, KERN_ERR, + "Zoned block device support is not enabled\n"); + goto free_sb_buf; + } +#else + if (bdev_zoned_model(sb->s_bdev) == BLK_ZONED_HM && + !f2fs_sb_mounted_blkzoned(sb)) { + f2fs_msg(sb, KERN_ERR, + "Zoned block device feature not enabled\n"); + goto free_sb_buf; + } +#endif + default_options(sbi); /* parse mount options */ options = kstrdup((const char *)data, GFP_KERNEL);