From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754303AbbIIQzS (ORCPT ); Wed, 9 Sep 2015 12:55:18 -0400 Received: from smtprelay0063.hostedemail.com ([216.40.44.63]:45278 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751957AbbIIQzP (ORCPT ); Wed, 9 Sep 2015 12:55:15 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::,RULES_HIT:41:355:379:541:599:973:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1540:1593:1594:1711:1730:1747:1777:1792:2198:2199:2393:2553:2559:2562:2828:3138:3139:3140:3141:3142:3352:3622:3865:3866:3867:3868:3870:3871:3872:3874:4321:5007:6261:8603:10004:10400:10848:11026:11232:11658:11914:12296:12517:12519:12740:13069:13311:13357:21080,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0 X-HE-Tag: cord09_67b15e126c134 X-Filterd-Recvd-Size: 1903 Message-ID: <1441817711.17219.61.camel@perches.com> Subject: Re: [PATCH] lib/vsprintf.c: increase the size of the field_width variable From: Joe Perches To: Tejun Heo Cc: Maurizio Lombardi , akpm@linux-foundation.org, linux@rasmusvillemoes.dk, linux-kernel@vger.kernel.org Date: Wed, 09 Sep 2015 09:55:11 -0700 In-Reply-To: <20150909163643.GC22909@mtj.duckdns.org> References: <1441793590-23856-1-git-send-email-mlombard@redhat.com> <1441816432.17219.57.camel@perches.com> <20150909163643.GC22909@mtj.duckdns.org> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.12.11-0ubuntu3 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2015-09-09 at 12:36 -0400, Tejun Heo wrote: > On Wed, Sep 09, 2015 at 09:33:52AM -0700, Joe Perches wrote: > > On Wed, 2015-09-09 at 12:13 +0200, Maurizio Lombardi wrote: > > > When printing a bitmap using the "%*pb[l]" printk format > > > a 16 bit variable (field_width) is used to store the size of the bitmap. > > > In some cases 16 bits are not sufficient, the variable overflows and > > > printk does not work as expected. > > > > If more than 16 bits are necessary, it couldn't work > > as a single printk is limited to 1024 bytes. > > It's weird to fail silently tho. What we can do is just capping it at > 16bit max and append something to indicate that the bitmap has been > truncated if truncation actually happened. It might be reasonable to output ... after the last comma or dash of the bitmap output when buf >= end. It also might be better to not reuse spec in bitmap_string and bitmap_list_string.