Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1739008pxk; Sat, 26 Sep 2020 03:28:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxSROgRwAe9OereqbRAv6CP/x2j/m/r/emgqIciP20wg8Z+fwSFXYWqTBlzjuPfej00DPS1 X-Received: by 2002:a17:906:6682:: with SMTP id z2mr7187910ejo.434.1601116119564; Sat, 26 Sep 2020 03:28:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601116119; cv=none; d=google.com; s=arc-20160816; b=o6g41k3zBaJN9nNEKH21eH7q+bhXmEDZPHyRCI0l8qOvwRzvYQ9EEhEhlA8FXqnzOk m1d/45RJX2Y9A1Ffpba5I/A7+ysCPCa0GRli4h3Pj8rvo9c10zpCgLqV6WGW9jx6fJlj 84zVGG10VJQQfucBc9XGpSAXvuhwnplsT5UvDIHUQsWwFNykpQuGKoZgzwLG98CdxEen 3N5tdj5SPBIbqTX2VGbCA/99rO/uYQPpmq13WfQc2GDdZAom9x0eVu+hUuKeVTAU85sc bUYldogI0ditRJFUdBSMUZJz726kzHLTbd3vwUldQKGeUErfDRkX4vrnC5KCgmxIRbZw OWow== 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=9rn4hwaaMn43KMWuMHu5n7MdUT9w/EZh7+OWhC54k/c=; b=vWZmIZmzIuEuLoVG4stZDW9vMpy8H7/qjkD0SoWODA6A6sV2LS1bvdKxxEBBej+LSO 8kwbtjwpkmidlR0H4C9WT9GH/z8FXvCEJN5i7HPLdNlG03v+EDdt216QUaCbmiP7GfB3 nmPqVwHv57N/Qw+uq2fsWeH/2qcf1f1o4f3wYAJKzCKHqgM0zA0/6l4mr7Be2ETntQcT jashPz/hpFi5IKzQTsrFb/khAKfBKksnvL7ZKYGSR/X/O2UJSv6/qJR7xIABLVw2AHtv 9YhBHDktp8PmiwT8DQyEl1v1fjyFFXHSAVGnzet6/UNPE/S86lSxFBiMX0+DNuYRo23G A1lg== 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 y39si4206989ede.275.2020.09.26.03.28.00; Sat, 26 Sep 2020 03:28:39 -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 S1726239AbgIZK1z (ORCPT + 99 others); Sat, 26 Sep 2020 06:27:55 -0400 Received: from mslow2.mail.gandi.net ([217.70.178.242]:39128 "EHLO mslow2.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726210AbgIZK1z (ORCPT ); Sat, 26 Sep 2020 06:27:55 -0400 Received: from relay7-d.mail.gandi.net (unknown [217.70.183.200]) by mslow2.mail.gandi.net (Postfix) with ESMTP id 709473AA882 for ; Sat, 26 Sep 2020 10:25:37 +0000 (UTC) X-Originating-IP: 50.39.163.217 Received: from localhost (50-39-163-217.bvtn.or.frontiernet.net [50.39.163.217]) (Authenticated sender: josh@joshtriplett.org) by relay7-d.mail.gandi.net (Postfix) with ESMTPSA id 311F920003; Sat, 26 Sep 2020 10:25:14 +0000 (UTC) Date: Sat, 26 Sep 2020 03:25:12 -0700 From: Josh Triplett To: linux-ext4@vger.kernel.org Cc: 971014@bugs.debian.org Subject: Reproducible bug in inline_data handling with ACL Message-ID: <20200926102512.GA11386@localhost> References: <160110861360.7199.11561753808099731033.reportbug@s> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <160110861360.7199.11561753808099731033.reportbug@s> Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org Adding CC to linux-ext4@. On Sat, Sep 26, 2020 at 01:23:33AM -0700, Josh Triplett wrote: > In the course of creating some filesystems containing Debian > installations using `mke2fs -d`, I managed to find a bug in the > `inline_data` handling, which seems to apply to files containing ACLs. > On a default Debian installation, /var/log/journal triggered this > problem. > > I managed to create a minimal test case. To reproduce: > > mkdir -p target/testdir > setfacl --restore=- < # file: target/testdir/ > user::rwx > group::r-x > group:adm:r-x > mask::r-x > other::r-x > default:user::rwx > default:group::r-x > default:group:adm:r-x > default:mask::r-x > default:other::r-x > EOF > mke2fs -b 4096 -I 256 -O sparse_super2,inline_data,^has_journal -d target disk.img 8M > > and then run: > > e2fsck -n -f disk.img > > This will show: > > e2fsck 1.46-WIP (03-Oct-2019) > Pass 1: Checking inodes, blocks, and sizes > Inode 12 has INLINE_DATA_FL flag but extended attribute not found. Truncate? no > > Pass 2: Checking directory structure > Pass 3: Checking directory connectivity > Pass 4: Checking reference counts > Pass 5: Checking group summary information > > disk.img: ********** WARNING: Filesystem still has errors ********** > > disk.img: 12/2048 files (0.0% non-contiguous), 137/2048 blocks > > > And the kernel ext4 implementation will fail to handle that inode, with > a message like this: > > EXT4-fs error (device loop0): __ext4_iget:4776: inode #3215: block 56: comm ls: invalid block > > > The size of 8M doesn't matter; the issue reproduces with other sizes. > /etc/mke2fs.conf is unchanged from the defaults. `tune2fs -l disk.img` > shows the following: > > tune2fs 1.46-WIP (03-Oct-2019) > Filesystem volume name: > Last mounted on: > Filesystem UUID: 931e3151-83db-4c33-be5f-655c9323fab4 > Filesystem magic number: 0xEF53 > Filesystem revision #: 1 (dynamic) > Filesystem features: ext_attr resize_inode dir_index sparse_super2 filetype inline_data sparse_super large_file > Filesystem flags: signed_directory_hash > Default mount options: user_xattr acl > Filesystem state: clean > Errors behavior: Continue > Filesystem OS type: Linux > Inode count: 2048 > Block count: 2048 > Reserved block count: 102 > Free blocks: 1911 > Free inodes: 2036 > First block: 0 > Block size: 4096 > Fragment size: 4096 > Blocks per group: 32768 > Fragments per group: 32768 > Inodes per group: 2048 > Inode blocks per group: 128 > Filesystem created: Sat Sep 26 00:50:53 2020 > Last mount time: n/a > Last write time: Sat Sep 26 00:50:53 2020 > Mount count: 0 > Maximum mount count: -1 > Last checked: Sat Sep 26 00:50:53 2020 > Check interval: 0 () > Reserved blocks uid: 0 (user root) > Reserved blocks gid: 0 (group root) > First inode: 11 > Inode size: 256 > Required extra isize: 32 > Desired extra isize: 32 > Default directory hash: half_md4 > Directory Hash Seed: df46d104-ed26-4cea-ac61-0feff2a54622