From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751500AbbDBUrw (ORCPT ); Thu, 2 Apr 2015 16:47:52 -0400 Received: from imap.thunk.org ([74.207.234.97]:47814 "EHLO imap.thunk.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750781AbbDBUrv (ORCPT ); Thu, 2 Apr 2015 16:47:51 -0400 Date: Thu, 2 Apr 2015 16:47:48 -0400 From: "Theodore Ts'o" To: Rasmus Villemoes Cc: Andreas Dilger , linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] ext4: fix transposition typo in format string Message-ID: <20150402204748.GC450@thunk.org> Mail-Followup-To: Theodore Ts'o , Rasmus Villemoes , Andreas Dilger , linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org References: <1424441495-32581-1-git-send-email-linux@rasmusvillemoes.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1424441495-32581-1-git-send-email-linux@rasmusvillemoes.dk> User-Agent: Mutt/1.5.23 (2014-03-12) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: tytso@thunk.org X-SA-Exim-Scanned: No (on imap.thunk.org); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 20, 2015 at 03:11:35PM +0100, Rasmus Villemoes wrote: > According to C99, %*.s means the same as %*.0s, in other words, print > as many spaces as the field width argument says and effectively ignore > the string argument. That is certainly not what was meant here. The > kernel's printf implementation, however, treats it as if the . was not > there, i.e. as %*s. I don't know if de->name is nul-terminated or not, > but in any case I'm guessing the intention was to use de->name_len as > precision instead of field width. Applied, sorry for the delay. (Note: the code is explicitly #ifdef'ed out so the only way the bug would show up is if a developer explicitly modified the source to #define INLINE_DIR_DEBUG, so it's not -stable material.) - Ted