Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp1023482ybi; Wed, 19 Jun 2019 12:01:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqw+gtKzE/NVpoW0fLzQrow6sqdGDF4a4Lombc2P0uWishMlh4oQU45CVequYDTx3zQr/6ij X-Received: by 2002:a63:205b:: with SMTP id r27mr9223104pgm.330.1560970896388; Wed, 19 Jun 2019 12:01:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560970896; cv=none; d=google.com; s=arc-20160816; b=FO9LDD2uwn8OxpyjcVRTD4676OxlXEIHLVgZb4Cry2s2wD3Q6v1TrJYl2/QZCVSoPK mdo4nLmGBf1bA460DsHQnkDPjpp4qLtJcsolIDpWqd5kBi7BiLNBTj2piJ3Q1kVznIUK WOXxMeiJ7huFgKRc/jbWrTXoK1PcadcE8nvJnBXoBhACs2mPDD/88wlX4DVU4QrI7MmH IieOqIcUxeALB+QlHPedt8Y3zfUYjpG+X57+NUwfPLWepNL20zzjiPaHxEKZp99A2rwD x9LFTVUaETwrGd7suD+VI1sYJklD+MwL3yovdAO3sLgOtBmTH3tFNUZnFyfJITyezw+C hjHA== 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; bh=0NCX+zV9XrdlPcudzUxa7PV8t+iv7UOZs8YnRHoeKtA=; b=YYQIWuY/uloWqrZLyc+ISYKbvnJsLCR8urc5JxDE3hAlmd40ApeM7Z7M116FYF3nHd rg+NI/NqUUB3GOF/bK4idLAFvWyZSP8qsl7vqRRbWl2uWkEcLOxty6DCZINOPFpUR6/g YveR9N8YkFm0+8UB7V7GRi3nGjvrXw20voNM6Hx4nSrZ6t/xczr0uXrFP8xevToRxr7P qFK80sxCXzTbEov8xhKwsdtbyw9STN8Ps+mWq9IQZPbIMcJpfHdrDi5tKBw+0w5MPHLJ OK7qEsUNj/18YN3demMIJT6PCMVsaLBLB8vH15pqfz/RFTfQ+aSH50dS970ZZ4tJMiyE zfbA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-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 w185si17768849pfb.170.2019.06.19.12.01.12; Wed, 19 Jun 2019 12:01:36 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-ext4-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-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726496AbfFSTAf (ORCPT + 99 others); Wed, 19 Jun 2019 15:00:35 -0400 Received: from outgoing-auth-1.mit.edu ([18.9.28.11]:42071 "EHLO outgoing.mit.edu" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726449AbfFSTAf (ORCPT ); Wed, 19 Jun 2019 15:00:35 -0400 Received: from callcc.thunk.org (guestnat-104-133-0-109.corp.google.com [104.133.0.109] (may be forged)) (authenticated bits=0) (User authenticated as tytso@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id x5JJ0U1h016837 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 19 Jun 2019 15:00:31 -0400 Received: by callcc.thunk.org (Postfix, from userid 15806) id EE544420484; Wed, 19 Jun 2019 15:00:29 -0400 (EDT) Date: Wed, 19 Jun 2019 15:00:29 -0400 From: "Theodore Ts'o" To: Artem Blagodarenko Cc: linux-ext4@vger.kernel.org, adilger.kernel@dilger.ca, linux@rasmusvillemoes.dk Subject: Re: [PATCH] e2fsck: process empty directory if large_dir and inline_data set Message-ID: <20190619190029.GA3383@mit.edu> References: <20190614144237.6010-1-c17828@cray.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190614144237.6010-1-c17828@cray.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Fri, Jun 14, 2019 at 05:42:37PM +0300, Artem Blagodarenko wrote: > Doing a forced check on an ext4 file system with inline_data and > large_dir results in lots of fsck messages. To reproduce: > ... > > Rootcause of this issue is large_dir optimization that is not > appropriate for inline_data. > > Let's not optimize it if inline_data is set. > > Reported-by: Rasmus Villemoes > Signed-off-by: Artem Blagodarenko Thanks, applied, although I corrected the commit description. The initial description now reads: e2fsck: correctly handle inline directories when large_dir is enabled. Historically, e2fsck has required that directories not contain holes. (In fact, as of this writing, ext4 still requires this to be the case.) Commit ae9efd05a98 ("e2fsck: 3 level hash tree directory optimization") removed this requirement if the large_dir feature is enabled; however, the way it was done caused it to incorrectly handle inline directories. To reproduce the problem fixed by this commit: ... BTW, Removing the directory hole check in commit ae9efd05a98 for file systems with the large_dir feature enabled was a wee bit optimistic, since the kernel will still mark the file system as corrupted. Fixing the kernel so that it doesn't complain about directories with holes is going to be a bit more complicated than just removing the check in __ext4_read_dirblock(): if (!bh) { ext4_error_inode(inode, func, line, block, "Directory hole found"); return ERR_PTR(-EFSCORRUPTED); } (That's because we have to fix all of the callers of ext4_read_dirblock() to handle the case where it returns NULL if there is no directory block at that specified location.) I should have caught that when reviewing the e2fsprogs commit; my bad. At this point, we should just fix the kernel so it can handle directories with holes (both for large_dir and non-large_dir directories). - Ted