[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20190619190029.GA3383@mit.edu>
Date: Wed, 19 Jun 2019 15:00:29 -0400
From: "Theodore Ts'o" <tytso@....edu>
To: Artem Blagodarenko <artem.blagodarenko@...il.com>
Cc: linux-ext4@...r.kernel.org, adilger.kernel@...ger.ca,
linux@...musvillemoes.dk
Subject: Re: [PATCH] e2fsck: process empty directory if large_dir and
inline_data set
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@...musvillemoes.dk>
> Signed-off-by: Artem Blagodarenko <c17828@...y.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
Powered by blists - more mailing lists