Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755013AbbHXVZQ (ORCPT ); Mon, 24 Aug 2015 17:25:16 -0400 Received: from mout.gmx.net ([212.227.15.15]:55921 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754959AbbHXVZO (ORCPT ); Mon, 24 Aug 2015 17:25:14 -0400 Message-ID: <55DB8B95.7050005@gmx.de> Date: Mon, 24 Aug 2015 23:24:37 +0200 From: Heinrich Schuchardt User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.8.0 MIME-Version: 1.0 To: Andrew Morton , Sean Fu CC: "Eric W. Biederman" , Andrey Ryabinin , Ulrich Obergfell , "Steven Rostedt (Red Hat)" , Prarit Bhargava , Eric B Munson , "Paul E. McKenney" , Johannes Weiner , Thomas Gleixner , Don Zickus , David Rientjes , linux-kernel@vger.kernel.org Subject: Re: [PATCH] kernel/sysctl.c: If "count" including the terminating byte '\0' the write system call should retrun success. References: <20150824134408.be0ffaa654f7d26802119b81@linux-foundation.org> In-Reply-To: <20150824134408.be0ffaa654f7d26802119b81@linux-foundation.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:WM3YtPNWke1W7OvcoNSQsDKnMTsAzdnoQTTmQ2WPFHBOFvaCh85 lKbuv0jHFh/PAJh+VR3jW9hCh1IfWG+DneJ7APLS0w5I3p5t23JWr9YdbyJRfgLp+vdBRzF Ct9cicAaGwQC67YMJgkFwUCU2qtT3P75A4hg3YpLg429eIPd4Hfk5zvUH9XwBuWA4RKy/DB B6bRAqug3aFg0X5J4W/zQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:+fvBSshkXro=:NCiFyW3L+ay5L2NY0zIB6C YU/i/w4PnZw/mawBd5rTrgRqNVrFb96ywCKioGs1asNI8GXKGTPPcgDrYFOakA+lSxy1JiZCG Uhstql6s8VibbfSbOnlttBCU01fr38hFYv+3ZPKh3pmwJo89GFeaM+1rFM2v1pN4ncc9kdOnx /zPFcImjmw5+lFtAx/BHuQUdYuMXiIwgxjVdE65VLzBxIAtaTins4G29Oz4+5lrsB8uN+fffF BedBtkK+rVHEEGtjXYQOas9YjD5N9WGHpNMe6/4ytG3/v7lXpe9qIW4AxJ1Mc/qtv1vfOzUMc FZOqIx6jbybiXGQd3q2jLu588fbZtXTk+nrxxtjQPr/U248vYO4aI/hhvwIYPTnxDgXNi0s46 AkfazQsoPXuV1Aa2zv/UJYgSmzHStqyF5ZXn/cmbh1XPYxhkTziN4oZ3H2d/C8U9v7ElpTQxD 3GowIUAWHQKhxuWMDhB5037PnbFOKLPNztrz771VDCRJ+XBzZg0D3hQrsAiPL2J/OyovB6O9G +Kko51H3lBuGfb5zjEQpYoXv2vFT96+A7pQJeONZyBA1vlXhdD4nHWYnt0t6i77UXVLCvhl/X m3bhWiS8d2kT8atgA+3W2knDyiHugSGA/y2E27U+9U2QVWrHBgGRRd2gEgwQt5Z28aSidl0Hp WNWGPVxAYffyn6IWf+yVBEoqPJLU6qqUTZhguUvPLrJpxEv4P9z6qTWKXo7an2BWqviKPUdFC Pz86dD2DZda8SjF3hJ94OftxqxUt8y9TBsMtjQ== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1785 Lines: 48 This seems to be the relevant patch: https://lkml.org/lkml/2010/5/5/104 Amerigo Wang 2010-05-05 02:26:45 00b7c3395aec3df43de5bd02a3c5a099ca51169f +static const char proc_wspace_sep[] = { ' ', '\t', '\n' }; So since 2010 we have the current behavior. Best regards Heinrich Schuchardt On 24.08.2015 22:44, Andrew Morton wrote: > On Mon, 24 Aug 2015 23:33:58 +0800 Sean Fu wrote: > >> On Mon, Aug 24, 2015 at 8:27 PM, Eric W. Biederman >> wrote: >>> >>> >>> On August 24, 2015 1:56:13 AM PDT, Sean Fu wrote: >>>> when the input argument "count" including the terminating byte "\0", >>>> The write system call return EINVAL on proc file. >>>> But it return success on regular file. >>> >>> Nonsense. It will write the '\0' to a regular file because it is just data. >>> >>> Integers in proc are more than data. >>> >>> So I see no justification for this change. >> In fact, "write(fd, "1\0", 2)" on Integers proc file return success on >> 2.6 kernel. I already tested it on 2.6.6.60 kernel. >> >> So, The latest behavior of "write(fd, "1\0", 2)" is different from old >> kernel(2.6). >> This maybe impact the compatibility of some user space program. > > 2.6 was a long time ago. If this behaviour change has happened in the > last 1-2 kernel releases then there would be a case to consider making > changes. But if the kernel has been this way for two years then it's > too late to bother switching back to the old (and strange) behaviour. > > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/