Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp47492imm; Thu, 30 Aug 2018 06:43:05 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbRWBj/456jx0JDY10LDyQxvxzwZN/+iudSEGL/fd1nOG1JJvazkFxHYTE3kCUtUnuB/FOj X-Received: by 2002:a17:902:b03:: with SMTP id 3-v6mr10223062plq.277.1535636585893; Thu, 30 Aug 2018 06:43:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535636585; cv=none; d=google.com; s=arc-20160816; b=CZF3H+Vq9mPEqeJ/rlruU/XrYkNWHtAfWX4IbrIidcJjFLx/RFpqf4ZohZgaBC74dE kTE8SDIvWFlig07tS3MLi/9q6Aw1T8R1PCzDJlXT2SIf9dyEBLVYgND0Q/gdm+Rm/OkY /rmL99jhgJl4IiUo/BL2Auvls+fiAYVdfyWV5hEBR5OoyXNDde6uMQmvn+nPTDKzs4A9 vzW++PeKSZqtto9SljU6sZX38AkiR0DRT36lJlaeTeoa7qAx2jMB8Z4Lp/azS5mBZx9/ u6Z2Iei/V/ruCtBGC0qOCIMputAtOEQ0nzO9mBC8K6M64AqMZrnPNsdO8+NeNZOvK5Jt gOgw== 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-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=icPJyVtfPqCUsX6GsJCRJPXsmcomIQb22bZaVlouUl4=; b=cwSItn2y44Ufl5C9DFvZu6oqiVhOM+OeCX2GGjP4zL+FoncCxY6kyQa+8k2A4micYM YsI6nKZd2fnhJMZ3y4I6c7B0uzCQxo5bKykvn90jatjEz6Fr1paV/g3ERCVcWlCX2DN/ YkOpf9blEV74slo4auYmlxSURGep0Pd/RXAmcE2Gl6w9mcz+Oj9IuLd+4RwGWdt1zdi9 ujMwa96fEv+Zt52A+oX0kvK50kbK91nM6KlFworwnCjEDt2z2SBo+kRWDjqs1gQm7n4Q 9rKlLhctaDK2MRoLf/mc1Vl8pts+6Dtpkx+9ur9bmy5z6zoLlS6y1m9iM5EuhapzEuol chEw== 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 f9-v6si6314465pgi.12.2018.08.30.06.42.50; Thu, 30 Aug 2018 06:43:05 -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 S1728973AbeH3Rn3 (ORCPT + 99 others); Thu, 30 Aug 2018 13:43:29 -0400 Received: from metis.ext.pengutronix.de ([85.220.165.71]:48211 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728582AbeH3Rn3 (ORCPT ); Thu, 30 Aug 2018 13:43:29 -0400 Received: from ptx.hi.pengutronix.de ([2001:67c:670:100:1d::c0]) by metis.ext.pengutronix.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1fvNC4-00087K-7S; Thu, 30 Aug 2018 15:41:04 +0200 Received: from sha by ptx.hi.pengutronix.de with local (Exim 4.89) (envelope-from ) id 1fvNC3-0000J5-Fp; Thu, 30 Aug 2018 15:41:03 +0200 Date: Thu, 30 Aug 2018 15:41:03 +0200 From: Sascha Hauer To: Richard Weinberger Cc: linux-mtd@lists.infradead.org, David Gstir , kernel@pengutronix.de, linux-kernel@vger.kernel.org Subject: Re: [PATCH 14/25] ubifs: Add authentication nodes to journal Message-ID: <20180830134103.qftgy2hdlopfup5s@pengutronix.de> References: <20180704124137.13396-1-s.hauer@pengutronix.de> <1901352.nUraZMrBkh@blindfold> <20180829143834.wwojzrwmpadxqiqk@pengutronix.de> <1631201.FhrAdlTAGn@blindfold> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1631201.FhrAdlTAGn@blindfold> X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-IRC: #ptxdist @freenode X-Accept-Language: de,en X-Accept-Content-Type: text/plain X-Uptime: 15:31:44 up 78 days, 22:40, 48 users, load average: 0.09, 0.09, 0.09 User-Agent: NeoMutt/20170113 (1.7.2) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c0 X-SA-Exim-Mail-From: sha@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Aug 29, 2018 at 04:54:30PM +0200, Richard Weinberger wrote: > Am Mittwoch, 29. August 2018, 16:38:34 CEST schrieb Sascha Hauer: > > On Mon, Aug 27, 2018 at 10:48:26PM +0200, Richard Weinberger wrote: > > > > release_head(c, BASEHD); > > > > kfree(dent); > > > > + ubifs_add_dirt(c, lnum, ubifs_auth_node_sz(c)); > > > > > > You have to account it immediately because while a commit you have no longer > > > a reference to them? > > > Upon replay you should have since you scan LEBs anyway. > > > > What do you mean here? Is that a suggestion to change something? > > I don't fully understand how you keep the lprops dirty counter correct for > auth nodes. Hence the question. > > Auth nodes are not referenced by the index, so you have to keep track of > them manually. Yes. That's why I call ubifs_add_dirt(c, lnum, ubifs_auth_node_sz(c)) each time I create an auth node. > Is your current approach "mark them dirty immediately and rely on LPT commit" > to not get lost of an auth node? Yes, I mark the auth nodes dirty in the assumption that the correct values are written on a LPT commit. > > I expected auth nodes getting dirtied also during journal reply. Yes, this happens in replay.c replay_bud(). "used" gets increased with every node found except when it's an auth node. Here "used" is not increased, the result is that the auth node adds to the dirty space. Sascha -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |