Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp98670pxb; Fri, 15 Oct 2021 01:17:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwrj+BWVXXVUIuPN6vx1lLvQzWDqE43YJi9Q5MlcBDJLydqxC+66HVjw97/OYx6NkFRUuqc X-Received: by 2002:a63:e243:: with SMTP id y3mr8215226pgj.101.1634285829610; Fri, 15 Oct 2021 01:17:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634285829; cv=none; d=google.com; s=arc-20160816; b=gnyCJeumvyUYP3CFskpAbhc+wM/VpDHcK96NABCTswOYYlH5REuJV705JAxe5QGaba Kgk3ZDg0ZJsT0lPJFUVAT0ZGLKh20Eq9xR6Ld885mhs/YHcfr9Dx7R9AKYpPqIR33X/t NBd9EbsHFy8i3mQN4PSDImWZkP+U1BPokTQv0hDevZ2pTKz9L0uiZHypgaZ2mi/k1yS0 EfkuUD8ih5Bw9CFMThXAe+LWv3rABTbXqaZbaa4mw9HDqMqiPm8hndfd8spvENZeFCON W/z2RO9dizSBe9BMJkZ5EGh/k/7tkSzCVHZ/HbOBNHPHeQNl5aaqWu2xrcICUYA8vHAc lEHw== 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=CO2kNXM3be6XZ5NG+oz9lMl8e98idlyll94IQ8g26ao=; b=zq6RTIs9RoMw8nQKpLVL3qVeoF14e6cQ2dTqV4O82ZSvxT2IbQVVxv0bM3aJ/hNVS1 aGJniY4N9GirLdfaIYFEpHmcgCFkg1zYF7ExZ+3kVjULhTTBXAsZyTbZrfLHoguq3COY X0GmrT4P3J7pbwGz2AzAEELsUPPe3d+UzyDE0KXy+ehUN6K1BD0YbRAq20RvP6SUBWPf XQDxCjVL7MbRV/VSwAOE1MLXkvDeI9W1KSUnXd3xWyFbxGhGmcyq+ueJQjfat8r1TUU9 NIX9cFLmB401kHDCK6auiHb7Zf1WrBQx+E58dce4U+BmmgORCn4adQnpasAp+4zoVYgm DWYw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j1si6298157plr.451.2021.10.15.01.16.51; Fri, 15 Oct 2021 01:17:09 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233042AbhJOCvd (ORCPT + 99 others); Thu, 14 Oct 2021 22:51:33 -0400 Received: from out30-133.freemail.mail.aliyun.com ([115.124.30.133]:33413 "EHLO out30-133.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232960AbhJOCvc (ORCPT ); Thu, 14 Oct 2021 22:51:32 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R181e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04426;MF=hsiangkao@linux.alibaba.com;NM=1;PH=DS;RN=6;SR=0;TI=SMTPD_---0Us1lm4Q_1634266163; Received: from B-P7TQMD6M-0146.local(mailfrom:hsiangkao@linux.alibaba.com fp:SMTPD_---0Us1lm4Q_1634266163) by smtp.aliyun-inc.com(127.0.0.1); Fri, 15 Oct 2021 10:49:25 +0800 Date: Fri, 15 Oct 2021 10:49:23 +0800 From: Gao Xiang To: Theodore Ts'o 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=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Thu, Oct 14, 2021 at 05:57:32PM -0400, Theodore Ts'o wrote: > 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. > */ Hi Ted, Ok, thanks for the detailed behavior explanation yet I guess several checks of "test_opt(inode->i_sb, DELALLOC)" could be somewhat racy then? For example a check in __es_remove_extent() of extents_status.c? Thanks, Gao Xiang > > Cheers, > > - Ted