Received: by 2002:ac0:a591:0:0:0:0:0 with SMTP id m17-v6csp717410imm; Thu, 5 Jul 2018 07:47:05 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcIBGoIz3HIH1SaN6mxUAKNl5FBdrRgURpIqdakw3EtK/z6/yuQDRXPhHwca0uyqLsAPDZa X-Received: by 2002:a17:902:8a4:: with SMTP id 33-v6mr6408167pll.343.1530802025365; Thu, 05 Jul 2018 07:47:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530802025; cv=none; d=google.com; s=arc-20160816; b=wBRVj6RiMewIccBEI+fPM3w0VEdfBkIa8nMePnHvdHC1+KzTBvuq+ZpniqIPDVpOyt Wb+eX1a3OONWvwLwh9/6/nkSitjjyi982iuoyrvzyLcvSx8sKMzVV0Paaif6mczohWbN K1I1sCUmsX02TlJx7+Geiy/d3kaC/eDU80R0A5y8HnNpZXYQHq3EGamMFds3RtzNMePZ x89GtwSq21pBXkF6/vkL4KHTVl6vFz1p5lnlBTqyDga/CLbXudprsyA2rzal6GJtNIKz ZrhRbg676JqJCc2fTEA6up4HQBPXyttDaL/TamOq8kLWMT9PmI3AQuav/Ur8OGoCHasQ o/vw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=+2YmyfrGSvDA6b30DNU6Pz84CKjEKGFGead64atq2nA=; b=GWEpGsiJsnHLGIEcjedcYafmOKEKnLVNWw1RVRVdVoB7tNHaSr0ifnjVMyhGs4j/VR pszQFUvRXkrToGJQBSmrieBYHKMARvV1zxsOgpwXCISLWYKS3M9W12f1Dh01HHXZ/TZ7 11mHyJGWc0O7yGU/Uky51SG8m0n3Z7j79wDYHyAjryDJ8Em1ARjueOGjgkTTEloX3JQr BC3sVq/U7lZr+CXotOccPO4VI8Out8eNFM+MKOLHXN0Uh6ntzoSnKiQe+oUty9tjClxu 07YIsV6XCc86Uc1lh5YOHBDMtQ4XHEQ3zM/43sZ0PoCrFEQjy+NJ6Y9wHYctESS81wz4 1qRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=ZIYw1rvr; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a62-v6si6078558pge.262.2018.07.05.07.46.50; Thu, 05 Jul 2018 07:47:05 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=ZIYw1rvr; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753658AbeGEOqH (ORCPT + 99 others); Thu, 5 Jul 2018 10:46:07 -0400 Received: from mail-oi0-f67.google.com ([209.85.218.67]:43559 "EHLO mail-oi0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753353AbeGEOqG (ORCPT ); Thu, 5 Jul 2018 10:46:06 -0400 Received: by mail-oi0-f67.google.com with SMTP id b15-v6so17325374oib.10 for ; Thu, 05 Jul 2018 07:46:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=+2YmyfrGSvDA6b30DNU6Pz84CKjEKGFGead64atq2nA=; b=ZIYw1rvrXdSWlWQ3YKkHdU1sbXiddWzQgqd3Sqb8ZnG44qGftZxqIT/3FqcsmgQmWR RY52utzNAk5z9glOkG/YbGTWSym0N1/IvUPM57zdJ6T3gRvdqBefWWOV43J/2w3RVycO mEV00ccP3oPh+x3GJSKslaBfgbd6VlFJVOOLocutPeC38jCRB3ZbRi4/cCKRmuoyG9wr uj0dmc1yGt3BYEnuJKw9z4YiQiBTMskLwEhbMn8/eDJvy1OH+aATZ3MkivwLd5ZhorFk y1DuSwLHr7g8ZrXgK/LX2dkLk2hPKlOpEPaCzoalRi3BURD/Sq2SBsjJJ5N4JYiQ1Iyi Whzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=+2YmyfrGSvDA6b30DNU6Pz84CKjEKGFGead64atq2nA=; b=l5+5A0xme+zYC1wl6Jix8s3xntp4zkT5bU4V2gzHsI5MZN723VT8V1WcAywEgpAMa8 tXLgW1afbpGjlLmyWT7Xz/dvHIPwZM+PRFPDyJwPf9J5NS8kUUgh2Kcxn0y8eaTEp9vv Y2WIAr42L4W1Um4iSUaYvQOIpsQhFncU2zxLmajP3mFaPVY+1ZXwK/hDSw5gkei+CWyC 3BLm80cAJ6yQNxG7MGR0cxbNb3Whi49KJixvcbLVORGorC0MSwQb/v5M+z4Q+B78vWVn P5vmk3iiJy54cOmuG2SmXIwMYAi1/j7ycTX4J0D6r6PSzpgteYGiLtS85g6Kx+vdYApx oeLg== X-Gm-Message-State: APt69E1q+xaUbHEljvH6XFjUesK7Mq/KrPXR2OIyhTy58PzZLgLyhgcI u76N5ULrzKyvQ9HNxNy3qhWYiAKKFPRK3aJNDYYScw== X-Received: by 2002:aca:5f56:: with SMTP id t83-v6mr7487841oib.115.1530801965640; Thu, 05 Jul 2018 07:46:05 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a9d:3495:0:0:0:0:0 with HTTP; Thu, 5 Jul 2018 07:46:05 -0700 (PDT) In-Reply-To: <20180705082931.echvdqipgvwhghf2@linux-x5ow.site> References: <153077334130.40830.2714147692560185329.stgit@dwillia2-desk3.amr.corp.intel.com> <153077341292.40830.11333232703318633087.stgit@dwillia2-desk3.amr.corp.intel.com> <20180705082931.echvdqipgvwhghf2@linux-x5ow.site> From: Dan Williams Date: Thu, 5 Jul 2018 07:46:05 -0700 Message-ID: Subject: Re: [PATCH 13/13] libnvdimm, namespace: Publish page structure init state / control To: Johannes Thumshirn Cc: Andrew Morton , Ross Zwisler , Vishal Verma , Dave Jiang , Jeff Moyer , Christoph Hellwig , linux-nvdimm , Linux MM , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 5, 2018 at 1:29 AM, Johannes Thumshirn wrote: > On Wed, Jul 04, 2018 at 11:50:13PM -0700, Dan Williams wrote: >> +static ssize_t memmap_state_store(struct device *dev, >> + struct device_attribute *attr, const char *buf, size_t len) >> +{ >> + int i; >> + struct nd_pfn *nd_pfn = to_nd_pfn_safe(dev); >> + struct memmap_async_state *async = &nd_pfn->async; >> + >> + if (strcmp(buf, "sync") == 0) >> + /* pass */; >> + else if (strcmp(buf, "sync\n") == 0) >> + /* pass */; >> + else >> + return -EINVAL; > > Hmm what about: > > if (strncmp(buf, "sync", 4)) > return -EINVAL; > > This collapses 6 lines into 4. ...but that also allows 'echo "syncAndThenSomeGarbage" > /sys/.../memmap_state' to succeed.