linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Theodore Ts'o" <tytso@mit.edu>
To: Artem Blagodarenko <artem.blagodarenko@gmail.com>
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
Date: Wed, 19 Jun 2019 15:00:29 -0400	[thread overview]
Message-ID: <20190619190029.GA3383@mit.edu> (raw)
In-Reply-To: <20190614144237.6010-1-c17828@cray.com>

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 <linux@rasmusvillemoes.dk>
> Signed-off-by: Artem Blagodarenko <c17828@cray.com>

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

      reply	other threads:[~2019-06-19 19:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-14 14:42 [PATCH] e2fsck: process empty directory if large_dir and inline_data set Artem Blagodarenko
2019-06-19 19:00 ` Theodore Ts'o [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190619190029.GA3383@mit.edu \
    --to=tytso@mit.edu \
    --cc=adilger.kernel@dilger.ca \
    --cc=artem.blagodarenko@gmail.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux@rasmusvillemoes.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).