From patchwork Fri Apr 22 19:47:38 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Williams X-Patchwork-Id: 8915411 Return-Path: X-Original-To: patchwork-linux-nvdimm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 5DBDA9F372 for ; Fri, 22 Apr 2016 19:48:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 921FD20221 for ; Fri, 22 Apr 2016 19:48:29 +0000 (UTC) Received: from ml01.01.org (ml01.01.org [198.145.21.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A33002021B for ; Fri, 22 Apr 2016 19:48:28 +0000 (UTC) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 9A1621A2170; Fri, 22 Apr 2016 12:48:28 -0700 (PDT) X-Original-To: linux-nvdimm@lists.01.org Delivered-To: linux-nvdimm@lists.01.org Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by ml01.01.org (Postfix) with ESMTP id 0DF571A2170 for ; Fri, 22 Apr 2016 12:48:28 -0700 (PDT) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga101.fm.intel.com with ESMTP; 22 Apr 2016 12:48:27 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,518,1455004800"; d="scan'208";a="938252139" Received: from dwillia2-desk3.jf.intel.com (HELO dwillia2-desk3.amr.corp.intel.com) ([10.54.39.14]) by orsmga001.jf.intel.com with ESMTP; 22 Apr 2016 12:48:27 -0700 Subject: [ndctl PATCH 7/8] ndctl, create-namespace: fix sector mode default for pmem namespaces From: Dan Williams To: linux-nvdimm@lists.01.org Date: Fri, 22 Apr 2016 12:47:38 -0700 Message-ID: <146135445871.4228.1090587699596226202.stgit@dwillia2-desk3.amr.corp.intel.com> In-Reply-To: <146135442234.4228.904225076597683142.stgit@dwillia2-desk3.amr.corp.intel.com> References: <146135442234.4228.904225076597683142.stgit@dwillia2-desk3.amr.corp.intel.com> User-Agent: StGit/0.17.1-9-g687f MIME-Version: 1.0 X-BeenThere: linux-nvdimm@lists.01.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "Linux-nvdimm developer list." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linux-nvdimm-bounces@lists.01.org Sender: "Linux-nvdimm" X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The man page uses the following example for establishing a sector mode namespace: ndctl create-namespace -e namespace0.0 -f -m sector ...however this only works for blk-type namespaces to inherit a default sector size. Default to 4K in the pmem-type namespaces. Reported-by: Linda Knippers Signed-off-by: Dan Williams Tested-by: Linda Knippers --- builtin-xaction-namespace.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/builtin-xaction-namespace.c b/builtin-xaction-namespace.c index 7d555a7d14a1..6ae8d7aee849 100644 --- a/builtin-xaction-namespace.c +++ b/builtin-xaction-namespace.c @@ -410,6 +410,8 @@ static int validate_namespace_options(struct ndctl_namespace *ndns, else if (ndctl_namespace_get_type(ndns) == ND_DEVICE_NAMESPACE_BLK) p->sector_size = ndctl_namespace_get_sector_size(ndns); + else if (p->mode == NDCTL_NS_MODE_SAFE) + p->sector_size = 4096; } if (param.map) {