From patchwork Sun Dec 24 19:12:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Sandeen X-Patchwork-Id: 10132121 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 1FD0C60318 for ; Sun, 24 Dec 2017 19:12:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0C09428A28 for ; Sun, 24 Dec 2017 19:12:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F3B7028A53; Sun, 24 Dec 2017 19:12:16 +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.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI 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 9D97228A28 for ; Sun, 24 Dec 2017 19:12:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751097AbdLXTMQ (ORCPT ); Sun, 24 Dec 2017 14:12:16 -0500 Received: from sandeen.net ([63.231.237.45]:53574 "EHLO sandeen.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751095AbdLXTMP (ORCPT ); Sun, 24 Dec 2017 14:12:15 -0500 Received: from Liberator-5.netgear.com (unknown [50.35.53.244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTPSA id DD52177B2D0 for ; Sun, 24 Dec 2017 13:11:49 -0600 (CST) Subject: [PATCH 3/3] mkfs: do not allow both "dev" and "name" subopts for log or realtime From: Eric Sandeen To: linux-xfs References: <529c056a-a40c-06b8-a37e-3b1b7e664303@sandeen.net> Message-ID: <6ea46cfb-357b-17c4-fc5f-65598431526f@sandeen.net> Date: Sun, 24 Dec 2017 11:12:13 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <529c056a-a40c-06b8-a37e-3b1b7e664303@sandeen.net> Content-Language: en-US Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Today we can specify i.e. both logdev= and name= ; it works, with last-parsed-wins behavior: mkfs.xfs -f -l logdev=/dev/sda1,name=/dev/sda2 /dev/sda3 Make these conflict to resolve ambiguity; do the same for the realtime subvol. Signed-off-by: Eric Sandeen Reviewed-by: Darrick J. Wong --- -- To unsubscribe from this list: send the line "unsubscribe linux-xfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c index 035af03..5ae67d5 100644 --- a/mkfs/xfs_mkfs.c +++ b/mkfs/xfs_mkfs.c @@ -507,6 +507,7 @@ struct opt_params lopts = { }, { .index = L_DEV, .conflicts = { { &lopts, L_AGNUM }, + { &lopts, L_NAME }, { &lopts, L_INTERNAL }, { &lopts, LAST_CONFLICT } }, .defaultval = SUBOPT_NEEDS_VAL, @@ -529,6 +530,7 @@ struct opt_params lopts = { }, { .index = L_NAME, .conflicts = { { &lopts, L_AGNUM }, + { &lopts, L_DEV }, { &lopts, L_INTERNAL }, { &lopts, LAST_CONFLICT } }, .defaultval = SUBOPT_NEEDS_VAL, @@ -599,7 +601,8 @@ struct opt_params ropts = { .defaultval = SUBOPT_NEEDS_VAL, }, { .index = R_DEV, - .conflicts = { { &ropts, LAST_CONFLICT } }, + .conflicts = { { &ropts, R_NAME }, + { &ropts, LAST_CONFLICT } }, .defaultval = SUBOPT_NEEDS_VAL, }, { .index = R_FILE, @@ -609,7 +612,8 @@ struct opt_params ropts = { .conflicts = { { &ropts, LAST_CONFLICT } }, }, { .index = R_NAME, - .conflicts = { { &ropts, LAST_CONFLICT } }, + .conflicts = { { &ropts, R_DEV }, + { &ropts, LAST_CONFLICT } }, .defaultval = SUBOPT_NEEDS_VAL, }, { .index = R_NOALIGN,