Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp5118146pxb; Thu, 14 Oct 2021 20:00:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxsQ+vZeekTUtWHLGkEiaVSFmq8/wCPZ9SAcrGXxn30wzqFYTY0jwCuGStkqCmp3sJjfvv+ X-Received: by 2002:a62:1d46:0:b0:44d:1a4d:5d03 with SMTP id d67-20020a621d46000000b0044d1a4d5d03mr9166034pfd.55.1634266800557; Thu, 14 Oct 2021 20:00:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634266800; cv=none; d=google.com; s=arc-20160816; b=X4/Oz+uBk+S5zKMmZgiZfhjZs4GSzCVVmjszkHRjMyK1dBOp3WL1R+aV5xriUbEfZV pKu1T6cCt0bUkHpxEwaQT4piuwXm2l0xkseK5OUrDx61OpPHjnJPcZ03wTf/j1jKBtwv 9O9LCdqzK+k7yRH+p3duWKyUbs64dbiIBH43LnRu3p07GgbLZnoxefscgUuttK4sn7sj +0lA9p5pA48IVRmAHMCGceiWYcMkWaBXOlBORklBbYRSS/nCkg9Tf6d7gyC93vEHGxUI WJit+yU+rSo2XFfVL6Da8M5ioSfI1HONBYPnpb85tVzLuP23K/DMUV4GSQ2MTsFHSgFm kAAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=VHwD8BfXkd+ogCOLXNgXMnFVLmwsA0DSn94AQavMSZY=; b=jDngm0LvcdNcgkhO8Suo5KkTvBTLYmiguCLlA6RBON338Ua1J3qFb2j583ONT0KHTA +RXEKQJgFsOQwItzyMPxvfqfsAnC8G303Wkk53bNkcBfPoJSqiT/M1gWH3q9N0FeiuXV 0v208oDP8IN/Nj03cigTBlFwG3wlieqUsuu9S3RJFIajJyN9vlrAGtAe27FCFOH6xTFe uOT28KL151H938zrHmuroQ65Zas7haBRNCf7fHll9q47UVvntM4gbZqJ2RcBXn3XIWFt 1srVAN5MEfCnu/7g2ZjOvTGGq9/J29PlfEDGyPgoeP499qY2OVRVbggja19UAuSRNlQV DbbQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x8si7997663pfh.219.2021.10.14.19.59.41; Thu, 14 Oct 2021 20:00:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233169AbhJNV7w (ORCPT + 99 others); Thu, 14 Oct 2021 17:59:52 -0400 Received: from outgoing-auth-1.mit.edu ([18.9.28.11]:38510 "EHLO outgoing.mit.edu" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S229829AbhJNV7w (ORCPT ); Thu, 14 Oct 2021 17:59:52 -0400 Received: from cwcc.thunk.org (pool-72-74-133-215.bstnma.fios.verizon.net [72.74.133.215]) (authenticated bits=0) (User authenticated as tytso@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id 19ELvXSA011427 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 14 Oct 2021 17:57:33 -0400 Received: by cwcc.thunk.org (Postfix, from userid 15806) id E7FF515C00CA; Thu, 14 Oct 2021 17:57:32 -0400 (EDT) Date: Thu, 14 Oct 2021 17:57:32 -0400 From: "Theodore Ts'o" To: Gao Xiang Cc: "Rantala, Tommi T. (Nokia - FI/Espoo)" , "jefflexu@linux.alibaba.com" , "enwlinux@gmail.com" , "linux-ext4@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: Inode 2885482 (000000008e814f64): i_reserved_data_blocks (2) not cleared! Message-ID: References: <767ea5bb27e31cc58bea15cd2aec492946679bde.camel@nokia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Fri, Oct 15, 2021 at 02:06:52AM +0800, Gao Xiang wrote: > On Thu, Oct 14, 2021 at 12:54:14PM +0000, Rantala, Tommi T. (Nokia - FI/Espoo) wrote: > > Hi, > > > > I'm seeing these i_reserved_data_blocks not cleared! messages when using ext4 > > with nodelalloc, message added in: > > > > commit 6fed83957f21eff11c8496e9f24253b03d2bc1dc > > Author: Jeffle Xu > > Date: Mon Aug 23 14:13:58 2021 +0800 > > > > ext4: fix reserved space counter leakage > > > > I can quickly reproduce in 5.15.0-rc5-00041-g348949d9a444 by doing some > > filesystem I/O while toggling delalloc: > > > > > > while true; do mount -o remount,nodelalloc /; sleep 1; mount -o remount,delalloc /; sleep 1; done & > > git clone linux xxx; rm -rf xxx > > If I understand correctly, switching such option implies > sync inodes to write back exist delayed allocation blocks. Well, no. What it implies is that all writes after the remount into an unallocated portion of the file will be allocated at the time when the page is dirtied, instead of when the page is written back. It's possible for some pages to be written using delayed allocation, and some other pages in the legacy "allocate on page dirty" mechanism. This can happen when the file system is remounted; it can also happen when the file system starts getting close to 100% full. See the comment in ext4_nonda_switch: /* * switch to non delalloc mode if we are running low * on free block. The free block accounting via percpu * counters can get slightly wrong with percpu_counter_batch getting * accumulated on each CPU without updating global counters * Delalloc need an accurate free block accounting. So switch * to non delalloc when we are near to error range. */ Cheers, - Ted