From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CB8E635B135; Fri, 9 Jan 2026 12:09:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767960547; cv=none; b=jx4Jpop3ql6VmptPUqtUq0gdRPlM8HCUlAK136Pt7AnqDYO2ePPFF/3VS62jsvmfq9lOB+pqEJlZpLNHJ8DCFMbtGVfK6qIloqEkYy/ZhlfS74KZbJLy/UUhoWYpTmnxG1catE/KDLJZva/fAGqSlOOaH7KlhBot4yI1DYuEBV0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767960547; c=relaxed/simple; bh=EyZuUazGu5AWry6LBNIigVcgfYzpHCTa+Wyqf63i8Dc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=gOBkJY4N+jcUHtBWafA1XQ7GRj3TeGA3a+YN490U8FRrUKYP2YztN6sDBsVTmpJwvswWjcAT05eH0CJyFabXek5hAcSd7kEsRu4xlDz14JxbaqNGH3unDSwK7OZzsvQ3bo1lwg4VFnNyGm3UMVSSf2o4TJgESl72g1rS5jGeLN8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=xRW1a6mD; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="xRW1a6mD" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4C621C16AAE; Fri, 9 Jan 2026 12:09:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1767960547; bh=EyZuUazGu5AWry6LBNIigVcgfYzpHCTa+Wyqf63i8Dc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xRW1a6mDi3dHPnBfVOnoUfsow+EGE9MgH/uKAUt1Rk5pMnNvhZU9pBLVko3/0kUNN DMY96b7sXNLq1h3WAd15uMjLk858AN/rYa+Y32fW04lVdIUN8eqEuAh/Avv9Tz/30e kvTNpw94ByGH2O0PUKIl0NI29CRuIpBA00mRinek= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Baokun Li , Jan Kara , Theodore Tso , stable@kernel.org Subject: [PATCH 6.6 425/737] ext4: align max orphan file size with e2fsprogs limit Date: Fri, 9 Jan 2026 12:39:24 +0100 Message-ID: <20260109112149.984718531@linuxfoundation.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260109112133.973195406@linuxfoundation.org> References: <20260109112133.973195406@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Baokun Li commit 7c11c56eb32eae96893eebafdbe3decadefe88ad upstream. Kernel commit 0a6ce20c1564 ("ext4: verify orphan file size is not too big") limits the maximum supported orphan file size to 8 << 20. However, in e2fsprogs, the orphan file size is set to 32–512 filesystem blocks when creating a filesystem. With 64k block size, formatting an ext4 fs >32G gives an orphan file bigger than the kernel allows, so mount prints an error and fails: EXT4-fs (vdb): orphan file too big: 8650752 EXT4-fs (vdb): mount failed To prevent this issue and allow previously created 64KB filesystems to mount, we updates the maximum allowed orphan file size in the kernel to 512 filesystem blocks. Fixes: 0a6ce20c1564 ("ext4: verify orphan file size is not too big") Signed-off-by: Baokun Li Reviewed-by: Jan Kara Message-ID: <20251120134233.2994147-1-libaokun@huaweicloud.com> Signed-off-by: Theodore Ts'o Cc: stable@kernel.org Signed-off-by: Greg Kroah-Hartman --- fs/ext4/orphan.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/fs/ext4/orphan.c +++ b/fs/ext4/orphan.c @@ -8,6 +8,8 @@ #include "ext4.h" #include "ext4_jbd2.h" +#define EXT4_MAX_ORPHAN_FILE_BLOCKS 512 + static int ext4_orphan_file_add(handle_t *handle, struct inode *inode) { int i, j, start; @@ -589,7 +591,7 @@ int ext4_init_orphan_info(struct super_b * consuming absurd amounts of memory when pinning blocks of orphan * file in memory. */ - if (inode->i_size > 8 << 20) { + if (inode->i_size > (EXT4_MAX_ORPHAN_FILE_BLOCKS << inode->i_blkbits)) { ext4_msg(sb, KERN_ERR, "orphan file too big: %llu", (unsigned long long)inode->i_size); ret = -EFSCORRUPTED;