Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4763290yba; Wed, 10 Apr 2019 04:33:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqyfSd6Dv6qL/3XRSjP1bYTH0Hc8nKJT66qHoNmfYJZbB/v7nxoQsK1MU7KX/mmZcJOsVG6F X-Received: by 2002:a63:4616:: with SMTP id t22mr40705032pga.217.1554896004966; Wed, 10 Apr 2019 04:33:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554896004; cv=none; d=google.com; s=arc-20160816; b=foYDTHo6HdKvbgfa3OeWHdMmtP1Y5M7sBvQxx2rWptNqOKb+C/j5GnHTj6M+W1TYZW a0OtAzeflkvvhn6Ma/a0EU8i9RLX85A9lzHqXCi6gkrVrNG5Tb7F6pAiPSuvixhZ4OKD rDIF7jpeVaCW7egJaHXKg0/IQfJsMNW4IsWv0ls1gGm521ztJcx8FWwLwm6VH2cTSK58 5wWsE896nCsr29Ws92waisWsZYV4uhveXxoZ7lk5N/6EYfuqT061xYaCZtVlhD2DxqPb c9KUfOb1dae6DG2CRl8LDEQc/DDt4j6QatY7N7wpJhOy5Y3eebgXF8/rYymjlCgFEntG ixCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=xytaywDVa1cfVOaPRV0L+JPaIuEQGnuauW6zIBSTPT0=; b=ToS6FGZM84Kpa4J94UOE5v1Vre1mefn3Fl+Oq4E571F2VPjjjPpUIkhNXW+ZhqMb/f xl3UFjctQH+3Ojdp81W6Qzm9CgEbaJOoCALmDKtjX3J63Ytd9OYrXTY8cS7KQsmvtUws 1Py8Gc8seDjDOJ+XZWm1lQzv42btWcq0aum5GyOjFuUu/xTWIUEfC1xxii/N7mwjyYb1 CHNKW5axwvzMFKm+W4eSxeN44NQydGx1xm7OxhAPRT8jNmG/aHh+WfN+1BVuHoElLxIr QyKfcXeh0TmlF8spLYMAjJyBE2hgltITdrCW+wXzt0leZENmGvjhodfXcGC2mEZiuFQk OWbw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a18si31215517pgk.464.2019.04.10.04.33.09; Wed, 10 Apr 2019 04:33:24 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731223AbfDJLbU (ORCPT + 99 others); Wed, 10 Apr 2019 07:31:20 -0400 Received: from mx2.suse.de ([195.135.220.15]:34660 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727206AbfDJLbU (ORCPT ); Wed, 10 Apr 2019 07:31:20 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 08A24AF1A; Wed, 10 Apr 2019 11:31:18 +0000 (UTC) Date: Wed, 10 Apr 2019 13:31:15 +0200 From: Johannes Thumshirn To: Thomas Gleixner Cc: LKML , Josh Poimboeuf , x86@kernel.org, Andy Lutomirski , Steven Rostedt , Alexander Potapenko , David Sterba , Chris Mason , Josef Bacik , linux-btrfs@vger.kernel.org Subject: Re: [RFC patch 29/41] btrfs: ref-verify: Simplify stack trace retrieval Message-ID: <20190410113115.GB4610@linux-x5ow.site> References: <20190410102754.387743324@linutronix.de> <20190410103646.221275815@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20190410103646.221275815@linutronix.de> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 10, 2019 at 12:28:23PM +0200, Thomas Gleixner wrote: > Replace the indirection through struct stack_trace with an invocation of > the storage array based interface. > > Signed-off-by: Thomas Gleixner > Cc: David Sterba > Cc: Chris Mason > Cc: Josef Bacik > Cc: linux-btrfs@vger.kernel.org > --- > fs/btrfs/ref-verify.c | 15 ++------------- > 1 file changed, 2 insertions(+), 13 deletions(-) > > --- a/fs/btrfs/ref-verify.c > +++ b/fs/btrfs/ref-verify.c > @@ -205,28 +205,17 @@ static struct root_entry *lookup_root_en > #ifdef CONFIG_STACKTRACE > static void __save_stack_trace(struct ref_action *ra) > { > - struct stack_trace stack_trace; > - > - stack_trace.max_entries = MAX_TRACE; > - stack_trace.nr_entries = 0; > - stack_trace.entries = ra->trace; > - stack_trace.skip = 2; > - save_stack_trace(&stack_trace); > - ra->trace_len = stack_trace.nr_entries; > + ra->trace_len = stack_trace_save(ra->trace, MAX_TRACE, 2); Stupid question: why are you passing a '2' for 'skipnr' and in stack_trace_save() from your series you set stack_trace::skip as skipnr + 1. Wouldn't this result in a stack_trace::skip = 3? Or is it the number of functions to be skipped and you don't want to have stack_trace_save() saved as well? Thanks, Johannes -- Johannes Thumshirn SUSE Labs Filesystems jthumshirn@suse.de +49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 N?rnberg GF: Felix Imend?rffer, Mary Higgins, Sri Rasiah HRB 21284 (AG N?rnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850