From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3A572C2D0A8 for ; Wed, 23 Sep 2020 09:45:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 035D4214D8 for ; Wed, 23 Sep 2020 09:45:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726420AbgIWJpA (ORCPT ); Wed, 23 Sep 2020 05:45:00 -0400 Received: from mx2.suse.de ([195.135.220.15]:42618 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726102AbgIWJpA (ORCPT ); Wed, 23 Sep 2020 05:45:00 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id EFD8BACB8; Wed, 23 Sep 2020 09:45:34 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id 5A3561E12E3; Wed, 23 Sep 2020 11:44:57 +0200 (CEST) Date: Wed, 23 Sep 2020 11:44:57 +0200 From: Jan Kara To: Mikulas Patocka Cc: Theodore Ts'o , Andreas Dilger , linux-ext4@vger.kernel.org, Dan Williams , Linus Torvalds , Alexander Viro , Andrew Morton , Vishal Verma , Dave Jiang , Ira Weiny , Matthew Wilcox , Jan Kara , Eric Sandeen , Dave Chinner , Linux Kernel Mailing List , linux-fsdevel Subject: Re: A bug in ext4 with big directories (was: NVFS XFS metadata) Message-ID: <20200923094457.GB6719@quack2.suse.cz> References: <20200922050314.GB12096@dread.disaster.area> <20200923024528.GD12096@dread.disaster.area> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org Hi! On Wed 23-09-20 05:20:55, Mikulas Patocka wrote: > There seems to be a bug in ext4 - when I create very large directory, ext4 > fails with -ENOSPC despite the fact that there is plenty of free space and > free inodes on the filesystem. > > How to reproduce: > download the program dir-test: > http://people.redhat.com/~mpatocka/benchmarks/dir-test.c > > # modprobe brd rd_size=67108864 > # mkfs.ext4 /dev/ram0 > # mount -t ext4 /dev/ram0 /mnt/test > # dir-test /mnt/test/ 8000000 8000000 > deleting: 7999000 > 2540000 > file 2515327 can't be created: No space left on device > # df /mnt/test > /dev/ram0 65531436 633752 61525860 2% /mnt/test > # df -i /mnt/test > /dev/ram0 4194304 1881547 2312757 45% /mnt/test Yeah, you likely run out of space in ext4 directory h-tree. You can enable higher depth h-trees with large_dir feature (mkfs.ext4 -O large_dir). Does that help? Honza -- Jan Kara SUSE Labs, CR