linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* A bug in ext4 with big directories (was: NVFS XFS metadata)
       [not found]                   ` <20200923024528.GD12096@dread.disaster.area>
@ 2020-09-23  9:20                     ` Mikulas Patocka
  2020-09-23  9:44                       ` Jan Kara
  0 siblings, 1 reply; 4+ messages in thread
From: Mikulas Patocka @ 2020-09-23  9:20 UTC (permalink / raw)
  To: Theodore Ts'o, Andreas Dilger, linux-ext4
  Cc: 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

Hi

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

(I tried to increase journal size, but it has no effect on this bug)

Mikulas


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: A bug in ext4 with big directories (was: NVFS XFS metadata)
  2020-09-23  9:20                     ` A bug in ext4 with big directories (was: NVFS XFS metadata) Mikulas Patocka
@ 2020-09-23  9:44                       ` Jan Kara
  2020-09-23 12:46                         ` Mikulas Patocka
  2020-09-23 20:20                         ` Andreas Dilger
  0 siblings, 2 replies; 4+ messages in thread
From: Jan Kara @ 2020-09-23  9:44 UTC (permalink / raw)
  To: Mikulas Patocka
  Cc: Theodore Ts'o, Andreas Dilger, linux-ext4, 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

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 <jack@suse.com>
SUSE Labs, CR

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: A bug in ext4 with big directories (was: NVFS XFS metadata)
  2020-09-23  9:44                       ` Jan Kara
@ 2020-09-23 12:46                         ` Mikulas Patocka
  2020-09-23 20:20                         ` Andreas Dilger
  1 sibling, 0 replies; 4+ messages in thread
From: Mikulas Patocka @ 2020-09-23 12:46 UTC (permalink / raw)
  To: Jan Kara
  Cc: Theodore Ts'o, Andreas Dilger, linux-ext4, Dan Williams,
	Linus Torvalds, Alexander Viro, Andrew Morton, Vishal Verma,
	Dave Jiang, Ira Weiny, Matthew Wilcox, Eric Sandeen,
	Dave Chinner, Linux Kernel Mailing List, linux-fsdevel



On Wed, 23 Sep 2020, Jan Kara wrote:

> 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?

Yes, this helps.

Mikulas

> 
> 								Honza
> 
> -- 
> Jan Kara <jack@suse.com>
> SUSE Labs, CR


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: A bug in ext4 with big directories (was: NVFS XFS metadata)
  2020-09-23  9:44                       ` Jan Kara
  2020-09-23 12:46                         ` Mikulas Patocka
@ 2020-09-23 20:20                         ` Andreas Dilger
  1 sibling, 0 replies; 4+ messages in thread
From: Andreas Dilger @ 2020-09-23 20:20 UTC (permalink / raw)
  To: Jan Kara
  Cc: Mikulas Patocka, Ext4 Developers List, Matthew Wilcox, linux-fsdevel

[-- Attachment #1: Type: text/plain, Size: 1230 bytes --]

[cut down CC list, since I don't think most people care about this detail]

On Sep 23, 2020, at 3:44 AM, Jan Kara <jack@suse.cz> wrote:
> 
> 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?

You can also enable this feature on an existing filesystem by running
"tune2fs -O large_dir /dev/sdX".  It might need to be unmounted, not sure.

Cheers, Andreas






[-- Attachment #2: Message signed with OpenPGP --]
[-- Type: application/pgp-signature, Size: 873 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-09-23 20:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <alpine.LRH.2.02.2009151216050.16057@file01.intranet.prod.int.rdu2.redhat.com>
     [not found] ` <alpine.LRH.2.02.2009151332280.3851@file01.intranet.prod.int.rdu2.redhat.com>
     [not found]   ` <alpine.LRH.2.02.2009160649560.20720@file01.intranet.prod.int.rdu2.redhat.com>
     [not found]     ` <CAPcyv4gW6AvR+RaShHdQzOaEPv9nrq5myXDmywuoCTYDZxk-hw@mail.gmail.com>
     [not found]       ` <alpine.LRH.2.02.2009161254400.745@file01.intranet.prod.int.rdu2.redhat.com>
     [not found]         ` <CAPcyv4gD0ZFkfajKTDnJhEEjf+5Av-GH+cHRFoyhzGe8bNEgAA@mail.gmail.com>
     [not found]           ` <alpine.LRH.2.02.2009161359540.20710@file01.intranet.prod.int.rdu2.redhat.com>
     [not found]             ` <alpine.LRH.2.02.2009191336380.3478@file01.intranet.prod.int.rdu2.redhat.com>
     [not found]               ` <20200922050314.GB12096@dread.disaster.area>
     [not found]                 ` <alpine.LRH.2.02.2009220815420.16480@file01.intranet.prod.int.rdu2.redhat.com>
     [not found]                   ` <20200923024528.GD12096@dread.disaster.area>
2020-09-23  9:20                     ` A bug in ext4 with big directories (was: NVFS XFS metadata) Mikulas Patocka
2020-09-23  9:44                       ` Jan Kara
2020-09-23 12:46                         ` Mikulas Patocka
2020-09-23 20:20                         ` Andreas Dilger

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).