From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932921Ab3BOQa4 (ORCPT ); Fri, 15 Feb 2013 11:30:56 -0500 Received: from fieldses.org ([174.143.236.118]:58623 "EHLO fieldses.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755870Ab3BOQay (ORCPT ); Fri, 15 Feb 2013 11:30:54 -0500 Date: Fri, 15 Feb 2013 11:30:51 -0500 From: "J. Bruce Fields" To: Jeff Layton Cc: Tim Gardner , linux-kernel@vger.kernel.org, Trond Myklebust , linux-nfs@vger.kernel.org Subject: Re: [PATCH linux-next v2] lockd: nlmclnt_reclaim(): avoid stack overflow Message-ID: <20130215163050.GL8343@fieldses.org> References: <20130212211800.GG10267@fieldses.org> <1360770016-69586-1-git-send-email-tim.gardner@canonical.com> <20130214102038.52b1d292@tlielax.poochiereds.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130214102038.52b1d292@tlielax.poochiereds.net> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 14, 2013 at 10:20:38AM -0500, Jeff Layton wrote: > On Wed, 13 Feb 2013 08:40:16 -0700 > Tim Gardner wrote: > > > Even though nlmclnt_reclaim() is only one call into the stack frame, > > 928 bytes on the stack seems like a lot. Recode to dynamically > > allocate the request structure once from within the reclaimer task, > > then pass this pointer into nlmclnt_reclaim() for reuse on > > subsequent calls. > > > > smatch analysis: > > > > fs/lockd/clntproc.c:620 nlmclnt_reclaim() warn: 'reqst' puts > > 928 bytes on stack > > > > Also remove redundant assignment of 0 after memset. > > > > Cc: Trond Myklebust > > Cc: "J. Bruce Fields" > > Cc: linux-nfs@vger.kernel.org > > Signed-off-by: Tim Gardner > > --- > > > > Changes from v1 -- don't return -ENOMEM from a task thread because it is > > not propagated to the task creator. Instead print an error message and return. ... > Oops, just noticed there was a later version of this patch. Please > disregard my earlier mail... > > Reviewed-by: Jeff Layton Thanks, applying.--b.