From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752649AbbDRDBe (ORCPT ); Fri, 17 Apr 2015 23:01:34 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:45589 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751705AbbDRDBd (ORCPT ); Fri, 17 Apr 2015 23:01:33 -0400 Date: Sat, 18 Apr 2015 04:01:28 +0100 From: Al Viro To: NeilBrown Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, "Drokin, Oleg" , Andreas Dilger Subject: Re: [PATCH 02/20] STAGING/lustre: limit follow_link recursion using stack space. Message-ID: <20150418030128.GF889@ZenIV.linux.org.uk> References: <20150323023258.8161.32467.stgit@notabene.brown> <20150323023738.8161.97062.stgit@notabene.brown> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150323023738.8161.97062.stgit@notabene.brown> 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 Mon, Mar 23, 2015 at 01:37:38PM +1100, NeilBrown wrote: > lustre's ->follow_link() uses a lot of stack space and so > need to limit symlink recursion based on stack size. > > It currently tests current->link_count, but that will soon > become private to fs/namei.c. > So instead base on actual available stack space. > This patch aborts recursive symlinks in less than 2K of space > is available. This seems consistent with current code, but > hasn't been tested. BTW, in the best case that logics is fishy. We have "up to 5 levels with 4Kb stack and up to 7 with 8Kb one". Could somebody manage to dig out the reasons for such limits? Preferably along with the kernel version where the overflows had been observed, both for 4K and 8K cases. I'm very tempted to rip that thing out in the "kill link_path_walk() recursion completely" series...