Received: by 2002:a4a:301c:0:0:0:0:0 with SMTP id q28-v6csp1125125oof; Tue, 25 Sep 2018 08:34:27 -0700 (PDT) X-Google-Smtp-Source: ACcGV63DNyK40jjZDYDJcl9uwfG4RmKZ/0wip8x471zhtTQ7q/PyoB4ULaI6r9t6Wc+aD9fCpxx2 X-Received: by 2002:a17:902:7244:: with SMTP id c4-v6mr1667744pll.339.1537889667118; Tue, 25 Sep 2018 08:34:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537889667; cv=none; d=google.com; s=arc-20160816; b=IAOycile+GN8MqZIEDQQ23JK0XtpT88jYQKcwvnIoETMPQg16YXteGok09CAVuYAIX DXOiuCKMLQHetwb7CLPHiecPIR6d2vubhnBeEPVJoYs9O85m+ICtfglNBE7yJQJRRsZH eE2f32pxvR2T8BkUapt5B+dyLTPwJ9UCYh5+lTWpQXHzRBzg5AZ7+K/DsQHQ8XtszDo7 Xp56RUU+Ny4rE4fS1XpeATWlTzf7iYBXj3AgnCPJTaO8A0eVNFX/WxB09OS3SanXZvjx aSz/d0X93hSVD3hCn3kH3Bzjb+NbbpOl0hli/LwR+Pob+1zMLDzyBM7Gn+B2YcnxRal8 Gj/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=tq/8d4pyKnCQkV0mh9yjTCR3LVFdSWSL7V08AMaX4Nw=; b=bSsS9Wy+ZPCATWazMkJxbR1BIEHI2VVcH/KukpYqOiR5mP5UzkA7pAtBU9Xy6DwfMf ag4XfoQv4PHdTQOOsq95/K1h0gcKCkrh1Pzf2t0OjQehHmxRe8QiR2pn6MS3iI5zKrmS HBFLZPxmvMM9bRN3dxcS4GROsSKB/j7w+gLMTs4AhEQy6/g3wQLWRwmxS8QOGXbD0zfT cBwuqGn/WLWc2ciEKLEUCfaOwIQazOAIsWGc9ZwDDCL4liNCRHKX0+rNYag6MN4CxBt+ 0DA+1jJapbmzJh4I3PdVebeQWfN2iPQtl9lAWtGGLczMZPI7DRoz0mAtlV1Fq/f3ZFhy 7qSQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r7-v6si2553071pga.77.2018.09.25.08.34.11; Tue, 25 Sep 2018 08:34:27 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729640AbeIYVke (ORCPT + 99 others); Tue, 25 Sep 2018 17:40:34 -0400 Received: from mail5.windriver.com ([192.103.53.11]:59786 "EHLO mail5.wrs.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729438AbeIYVke (ORCPT ); Tue, 25 Sep 2018 17:40:34 -0400 Received: from ALA-HCA.corp.ad.wrs.com (ala-hca.corp.ad.wrs.com [147.11.189.40]) by mail5.wrs.com (8.15.2/8.15.2) with ESMTPS id w8PFVEQ6023180 (version=TLSv1 cipher=AES128-SHA bits=128 verify=FAIL); Tue, 25 Sep 2018 08:31:30 -0700 Received: from [128.224.162.216] (128.224.162.216) by ALA-HCA.corp.ad.wrs.com (147.11.189.50) with Microsoft SMTP Server (TLS) id 14.3.408.0; Tue, 25 Sep 2018 08:31:09 -0700 Subject: Re: [PATCH v2 1/2] printk: Fix panic caused by passing log_buf_len to command line To: Sergey Senozhatsky , Petr Mladek CC: Steven Rostedt , Sergey Senozhatsky , References: <1537291068-443145-1-git-send-email-zhe.he@windriver.com> <20180919015030.GA423@jagdpanzerIV> <6c354803-5341-7237-9ee3-7882252c7483@windriver.com> <20180919023932.GA14090@jagdpanzerIV> <20180918224312.6e9aef50@vmware.local.home> <1545bc85-b64a-4b45-d40f-79567ac621dc@windriver.com> <20180920123056.27b2cf18@gandalf.local.home> <20180921073753.mqayzofcofpmhiyu@pathway.suse.cz> <20180925120135.GB523@tigerII.localdomain> <20180925122300.qq5w4skwmxbzi6sy@pathway.suse.cz> <20180925133143.GB601@tigerII.localdomain> From: He Zhe Message-ID: <656c4059-ba7b-6756-5e7c-b4cf41c62a2a@windriver.com> Date: Tue, 25 Sep 2018 23:31:05 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20180925133143.GB601@tigerII.localdomain> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Content-Language: en-US X-Originating-IP: [128.224.162.216] Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018年09月25日 21:31, Sergey Senozhatsky wrote: > On (09/25/18 14:23), Petr Mladek wrote: >> The 32GB was mentioned as an example one year ego. This is not enough >> for a new syscall from my point of view. > I agree. I didn't think of syslog(); was merely thinking about logbuf > and flushing it to the consoles. syslog() stuff is a bit complex. We > sort of don't expect user space to allocate 64G to read all log_buf > messages, do we. > > I'm wondering if we can do something like this > > --- > > diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c > index cf275f4d7912..1b48b61da8fe 100644 > --- a/kernel/printk/printk.c > +++ b/kernel/printk/printk.c > @@ -1110,9 +1110,15 @@ static void __init log_buf_len_update(unsigned size) > /* save requested log_buf_len since it's too early to process it */ > static int __init log_buf_len_setup(char *str) > { > - unsigned size = memparse(str, &str); > + u64 size = memparse(str, &str); > > - log_buf_len_update(size); > + if (size > UINT_MAX) { > + size = UINT_MAX; > + pr_err("log_buf over 4G is not supported. " > + "Please contact printk maintainers.\n"); > + } > + > + log_buf_len_update((unsigned int)size); > > return 0; > } > > --- > > So we could know that "the day has come". I agree on this idea, a good way to collect the potential requirement. I can send v4 with it if no objection from other people. Thanks, Zhe > > -ss >