Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1473976

Re: [RESEND PATCH v2] memory-hotplug: fix store_mem_state() return value

Path csiph.com!news.mixmin.net!aioe.org!bofh.it!news.nic.it!robomod
From David Rientjes <rientjes@google.com>
Newsgroups linux.kernel
Subject Re: [RESEND PATCH v2] memory-hotplug: fix store_mem_state() return value
Date Thu, 01 Sep 2016 02:10:01 +0200
Message-ID <scnJT-Ri-3@gated-at.bofh.it> (permalink)
References <scfjk-40K-55@gated-at.bofh.it> <scfW2-4eb-21@gated-at.bofh.it> <sckiZ-74j-27@gated-at.bofh.it> <sckVJ-7wC-35@gated-at.bofh.it> <scngR-sq-3@gated-at.bofh.it>
X-Original-To Reza Arbab <arbab@linux.vnet.ibm.com>
Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=Ei4n3lZ43uydZ5UipK2ih2AMiSiOvEoX9d6uGz81Pdg=; b=AqaEIuuDAHgkoqGdFsMoOPcVarguiIDSdN/CCVtacJjD+omc2r0eQgfhXkI7rpKxw+ J5ReGnqXNz9F136k8MgpeiIkMGB2ITGjSdZojAtCKOVdrlusCBUj3MBw8xQaAzRA1Zh0 BPjBj7PPmnHnzBv76lrZPGgd+MUsT/Bjx4szsSq4mC7qfUS1aU465sGdBnTAXc/iqn0D Ui7NVCYlhS8ESSIxAU3N60RB9Eu7o5ZVI9MwZ/XmU7AyunKn1Y+aG6fipbUfUJZAE7wI 4+1AYZCC8e8QAVecJI/4k3Gp8pUOwDgINAl4mCSbxEcU59OaTVtpAewrKfCC8OTCMEyq JccQ==
X-Google-Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=Ei4n3lZ43uydZ5UipK2ih2AMiSiOvEoX9d6uGz81Pdg=; b=aHtMNbFVGo7fjC4XExAJOBN+ysbUJ3n5OsbCq6ul4/7rroU6nwKGwuEuf55FnHRTen Ac8mpmi73EI4rn6k8OOowFN1/GEpgZ+QXi0jgETKu3xuamLSlVtYx5ToSJdD0ITRD/fk GVccfiBKrBv7mZs2lliu3U2k59nCEnphs77hwGyULASrL3zl+VglKSzrb4Pi4xZ4wJor 4IvFt1ieStN2FVUkd4igM5IUQWzgGrokcrRRckxLdZB0tSZOsO3L7dJ7HyuTvArud7aT qXBnmklGCD4IDzRHPs+gqkYZiXjEQ5lQ3X0kS1PtWcVozSFOyjVEp9OFCqi11V7jGw1o Mxqw==
X-Gm-Message-State AE9vXwM5rXGD8N+1hLKzIbT/y6jIcPvzaE5EoccLuwRIoFuyGI6P9k7ExzDlLPp/HJ81OC+J
X-Received by 10.66.21.167 with SMTP id w7mr21726292pae.62.1472688207003; Wed, 31 Aug 2016 17:03:27 -0700 (PDT)
X-X-Sender rientjes@chino.kir.corp.google.com
User-Agent Alpine 2.10 (DEB 1266 2009-07-14)
MIME-Version 1.0
Content-Type TEXT/PLAIN; charset=US-ASCII
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 32
Organization linux.* mail to news gateway
X-Original-Cc Andrew Morton <akpm@linux-foundation.org>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Vlastimil Babka <vbabka@suse.cz>, Vitaly Kuznetsov <vkuznets@redhat.com>, Yaowei Bai <baiyaowei@cmss.chinamobile.com>, Joonsoo Kim <iamjoonsoo.kim@lge.com>, Dan Williams <dan.j.williams@intel.com>, Xishi Qiu <qiuxishi@huawei.com>, David Vrabel <david.vrabel@citrix.com>, Chen Yucong <slaoub@gmail.com>, Andrew Banman <abanman@sgi.com>, Seth Jennings <sjenning@redhat.com>, linux-mm@kvack.org, linux-kernel@vger.kernel.org
X-Original-Date Wed, 31 Aug 2016 17:03:25 -0700 (PDT)
X-Original-Message-ID <alpine.DEB.2.10.1608311652110.112811@chino.kir.corp.google.com>
X-Original-References <20160831150105.GB26702@kroah.com> <1472658241-32748-1-git-send-email-arbab@linux.vnet.ibm.com> <20160831132557.c5cf0985e3da5f2850a10b1d@linux-foundation.org> <alpine.DEB.2.10.1608311402520.33967@chino.kir.corp.google.com> <20160831233811.g6kf24fdhnfhn637@arbab-vm>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1473976

Show key headers only | View raw


On Wed, 31 Aug 2016, Reza Arbab wrote:

> > The correct fix is for store_mem_state() to return -EINVAL when
> > device_online() returns non-zero.
> 
> Let me put it to you this way--which one of these sysfs operations is behaving
> correctly?
> 
> 	# cd /sys/devices/system/memory/memory0
> 	# cat online
> 	1
> 	# echo 1 > online; echo $?
> 	0
> 
> or
> 
> 	# cd /sys/devices/system/memory/memory0
> 	# cat state
> 	online
> 	# echo online > state; echo $?
> 	-bash: echo: write error: Invalid argument
> 	1
> 
> One of them should change to match the other.
> 

Nope, the return value of changing state from online to online was 
established almost 11 years ago in commit 3947be1969a9.  This was broken 
by commit fa2be40fe7c0 ("drivers: base: use standard device online/offline 
for state change") which was not intended to introduce a functional 
change, but it did (memory_block_change_state() would have returned 
EINVAL, device_online() does not).

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [PATCH v2] memory-hotplug: fix store_mem_state() return value Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-08-31 14:30 +0200
  Re: [PATCH v2] memory-hotplug: fix store_mem_state() return value Reza Arbab <arbab@linux.vnet.ibm.com> - 2016-08-31 16:40 +0200
    Re: [PATCH v2] memory-hotplug: fix store_mem_state() return value Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-08-31 17:10 +0200
      [RESEND PATCH v2] memory-hotplug: fix store_mem_state() return value Reza Arbab <arbab@linux.vnet.ibm.com> - 2016-08-31 17:50 +0200
        Re: [RESEND PATCH v2] memory-hotplug: fix store_mem_state() return  value Andrew Morton <akpm@linux-foundation.org> - 2016-08-31 22:30 +0200
          Re: [RESEND PATCH v2] memory-hotplug: fix store_mem_state() return  value David Rientjes <rientjes@google.com> - 2016-08-31 23:10 +0200
            Re: [RESEND PATCH v2] memory-hotplug: fix store_mem_state() return  value Reza Arbab <arbab@linux.vnet.ibm.com> - 2016-09-01 01:40 +0200
              Re: [RESEND PATCH v2] memory-hotplug: fix store_mem_state() return  value David Rientjes <rientjes@google.com> - 2016-09-01 02:10 +0200
                Re: [RESEND PATCH v2] memory-hotplug: fix store_mem_state() return  value Reza Arbab <arbab@linux.vnet.ibm.com> - 2016-09-01 02:20 +0200
                Re: [RESEND PATCH v2] memory-hotplug: fix store_mem_state() return  value David Rientjes <rientjes@google.com> - 2016-09-01 02:30 +0200
                Re: [RESEND PATCH v2] memory-hotplug: fix store_mem_state() return  value Reza Arbab <arbab@linux.vnet.ibm.com> - 2016-09-01 04:00 +0200
  [RESEND PATCH v2] memory-hotplug: fix store_mem_state() return value Reza Arbab <arbab@linux.vnet.ibm.com> - 2016-08-31 16:40 +0200

csiph-web