From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752904Ab2IRReK (ORCPT ); Tue, 18 Sep 2012 13:34:10 -0400 Received: from mx1.redhat.com ([209.132.183.28]:21579 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752585Ab2IRReI (ORCPT ); Tue, 18 Sep 2012 13:34:08 -0400 Date: Tue, 18 Sep 2012 19:36:05 +0200 From: Oleg Nesterov To: Roland McGrath Cc: Denys Vlasenko , linux-kernel@vger.kernel.org, Andrew Morton , Amerigo Wang , "Jonathan M. Foote" , Pedro Alves Subject: Re: [PATCH -mm v2] coredump: extend core dump note section to contain file names of mapped files Message-ID: <20120918173605.GA27653@redhat.com> References: <1347980129-1510-1-git-send-email-vda.linux@googlemail.com> <20120918165819.583252C0A4@topped-with-meat.com> <20120918172720.GA26606@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120918172720.GA26606@redhat.com> User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/18, Oleg Nesterov wrote: > > On 09/18, Roland McGrath wrote: > > > > It's doubtful that rolling your own single loop actually performs better > > than just calling strlen and memcpy. Ah, I misread your message, sorry... > This is needed to advance 'name' if d_path() fails with !ENAMETOOLONG. > Probably needs a comment. > > Or perhaps 'filename = ""' case can handle this case itself. In this > case we do not even need strlen(), remaining = name - filename. Yes, but you strlen + memcpy as you suggested will work too. Oleg.