Skip to contentSkip to conversation

Size of directory entry 16 EiB according to "ls -l"

DISCUSSION Martin Steigerwald 3 participants 13 messages May 30, 2025 – Jun 12, 2025

lore
Share & tools
lore
#0 lore raw

Hi!

Summary: I am curious why "ls -l" reports 16 EiB as the size of a directory entry. As to what I can see the filesystem is perfectly fine.

Kernel 6.15, self compiled. 320 GiB BCacheFS on LUKS encrypted LVM. Checksums are xxhash. Filesystem was created recently on self compiled 6.15-rc7 with self-compiled bcachefs tools from git tag 1.25.2. "bcachefs" reports 1.25.1 as version number.

I have a directory entry that according to ls -l is quite big:

drwxrwxr-x 5 martin martin 18446744073709551400 DATE DIRECTORY

Or in human readable:

drwxrwxr-x 5 martin martin 16E DATE DIRECTORY

The directory contains about 100 GiB in 14 files. All but one of them between 7 GiB and 8 GiB. The other one is about 800 MiB.

Scrubbing reports no error.

Running "fsck.bcachefs -n" online does not report any errors:

% fsck.bcachefs -n DEVICE
Running fsck online
bcachefs (dm-5): check_alloc_info... done bcachefs (dm-5): check_lrus... done
bcachefs (dm-5): check_btree_backpointers... done bcachefs (dm-5): check_backpointers_to_extents... done bcachefs (dm-5): check_extents_to_backpointers... done bcachefs (dm-5): check_alloc_to_lru_refs... done bcachefs (dm-5): check_snapshot_trees... done bcachefs (dm-5): check_snapshots... done bcachefs (dm-5): check_subvols... done bcachefs (dm-5): check_subvol_children... done bcachefs (dm-5): delete_dead_snapshots... done bcachefs (dm-5): check_indirect_extents... done bcachefs (dm-5): check_root... done
bcachefs (dm-5): check_subvolume_structure... done bcachefs (dm-5): check_directory_structure... done

Cannot run "fsck.bachefs" offline currently as trying to dismount gives:

umount: /MNTPOINT: target is busy.

According to lsof there is no indication on why it would be busy.

Some hours ago I was able to dismount, but then "fsck.bcachefs -n" reported that the device would be busy. If need be I can disable automatic mounting through "fstab" temporarily to check offline.

However currently I have no indication anything is wrong with the filesystem. Still I am curious:

Why does "ls -l" tell me the size of that directory entry is 16 EiB?

I made another directory on the device and "ls -l" reports 0 as the size of the directory. I copied the contents of "/usr/bin" to it, but "ls -l" still reports 0 as the size. Due to LZ4 compression I still have enough free space to duplicate the files from that directory entry with 16 EiB size to a test directory if need be.

I have a sub volume on the device with 2 files of 75 GiB files and 6 very small files. "ls -l" reports 0 as the size of the directory which holds the sub volume.

So what does BCacheFS return as the size of a directory entry and how can it be 16 EiB?

Best,

Signature · 1 line
Martin
#1 lore raw
Quoted 5 lines · Martin Steigerwald

Hi!

Summary: I am curious why "ls -l" reports 16 EiB as the size of a directory entry. As to what I can see the filesystem is perfectly fine.

Quoted 8 lines

Kernel 6.15, self compiled. 320 GiB BCacheFS on LUKS encrypted LVM. Checksums are xxhash. Filesystem was created recently on self compiled 6.15-rc7 with self-compiled bcachefs tools from git tag 1.25.2. "bcachefs" reports 1.25.1 as version number.

I have a directory entry that according to ls -l is quite big:

drwxrwxr-x 5 martin martin 18446744073709551400 DATE DIRECTORY

Yes, this is due to a leftover from the directory i_size patchset that had to be reverted. As long as it's not causing issues it'll be a bit before I get to it, I've got higher priority bugs I'm working on right now (as usual).

Hongbo, whatever happened to that patchset? I thought you were going to fix it so we could get it back in later?

#2 lore raw

Kent Overstreet - 31.05.25, 01:16:04 CEST:

Quoted 10 lines · Martin Steigerwald
Quoted 9 lines

Summary: I am curious why "ls -l" reports 16 EiB as the size of a directory entry. As to what I can see the filesystem is perfectly fine.

Kernel 6.15, self compiled. 320 GiB BCacheFS on LUKS encrypted LVM. Checksums are xxhash. Filesystem was created recently on self compiled 6.15-rc7 with self-compiled bcachefs tools from git tag 1.25.2. "bcachefs" reports 1.25.1 as version number.

Quoted 8 lines
Quoted 3 lines

I have a directory entry that according to ls -l is quite big:

drwxrwxr-x 5 martin martin 18446744073709551400 DATE DIRECTORY

Yes, this is due to a leftover from the directory i_size patchset that had to be reverted. As long as it's not causing issues it'll be a bit before I get to it, I've got higher priority bugs I'm working on right now (as usual).

The filesystem is perfectly fine to as far as I can say.

And I have no software in use on that filesystem that relies on any specific value or calculation there¹, so absolutely no hurry from my point of view.

[1] I am not even sure whether it is save to assume anything for directory size in user space apps. "du" for example does not seem to take it into account – at least it does not pick up the 16 EiB –, not even with "--apparent-size". BTRFS shows some value there that appears to go up with the amount of directory entries. ext4 and XFS do as well, divisible through 4096.

Best,

Signature · 1 line
Martin
#3 lore raw
Quoted 26 lines · Martin Steigerwald

Kent Overstreet - 31.05.25, 01:16:04 CEST:

Quoted 10 lines · Martin Steigerwald
Quoted 9 lines

Summary: I am curious why "ls -l" reports 16 EiB as the size of a directory entry. As to what I can see the filesystem is perfectly fine.

Kernel 6.15, self compiled. 320 GiB BCacheFS on LUKS encrypted LVM. Checksums are xxhash. Filesystem was created recently on self compiled 6.15-rc7 with self-compiled bcachefs tools from git tag 1.25.2. "bcachefs" reports 1.25.1 as version number.

Quoted 8 lines
Quoted 3 lines

I have a directory entry that according to ls -l is quite big:

drwxrwxr-x 5 martin martin 18446744073709551400 DATE DIRECTORY

Yes, this is due to a leftover from the directory i_size patchset that had to be reverted. As long as it's not causing issues it'll be a bit before I get to it, I've got higher priority bugs I'm working on right now (as usual).

The filesystem is perfectly fine to as far as I can say.

And I have no software in use on that filesystem that relies on any specific value or calculation there¹, so absolutely no hurry from my point of view.

Quoted 6 lines

[1] I am not even sure whether it is save to assume anything for directory size in user space apps. "du" for example does not seem to take it into account – at least it does not pick up the 16 EiB –, not even with "--apparent-size". BTRFS shows some value there that appears to go up with the amount of directory entries. ext4 and XFS do as well, divisible through 4096.

Apparently this did break sshfs.

#4 lore raw
In reply to Kent Overstreet
Quoted 13 lines · Kent Overstreet
Quoted 12 lines · Martin Steigerwald

Hi!

Summary: I am curious why "ls -l" reports 16 EiB as the size of a directory entry. As to what I can see the filesystem is perfectly fine.

Kernel 6.15, self compiled. 320 GiB BCacheFS on LUKS encrypted LVM. Checksums are xxhash. Filesystem was created recently on self compiled 6.15-rc7 with self-compiled bcachefs tools from git tag 1.25.2. "bcachefs" reports 1.25.1 as version number.

I have a directory entry that according to ls -l is quite big:

Quoted 8 lines
Quoted 1 line

drwxrwxr-x 5 martin martin 18446744073709551400 DATE DIRECTORY

Yes, this is due to a leftover from the directory i_size patchset that had to be reverted. As long as it's not causing issues it'll be a bit before I get to it, I've got higher priority bugs I'm working on right now (as usual).

Hongbo, whatever happened to that patchset? I thought you were going to fix it so we could get it back in later?

I'm very sorry for the directory i_size problem. And this work has been postponed recently due to my other internal works. Yeah, I will get back to this work after this Dragon Boat festival. I'm really sorry I haven't dealt with it sooner.

Hongbo.

#5 lore raw
Quoted 21 lines · Hongbo Li
Quoted 19 lines · Kent Overstreet
Quoted 5 lines · Martin Steigerwald

Hi!

Summary: I am curious why "ls -l" reports 16 EiB as the size of a directory entry. As to what I can see the filesystem is perfectly fine.

Quoted 8 lines

Kernel 6.15, self compiled. 320 GiB BCacheFS on LUKS encrypted LVM. Checksums are xxhash. Filesystem was created recently on self compiled 6.15-rc7 with self-compiled bcachefs tools from git tag 1.25.2. "bcachefs" reports 1.25.1 as version number.

I have a directory entry that according to ls -l is quite big:

drwxrwxr-x 5 martin martin 18446744073709551400 DATE DIRECTORY

Yes, this is due to a leftover from the directory i_size patchset that had to be reverted. As long as it's not causing issues it'll be a bit before I get to it, I've got higher priority bugs I'm working on right now (as usual).

Quoted 6 lines
Quoted 2 lines

Hongbo, whatever happened to that patchset? I thought you were going to fix it so we could get it back in later?

I'm very sorry for the directory i_size problem. And this work has been postponed recently due to my other internal works. Yeah, I will get back to this work after this Dragon Boat festival. I'm really sorry I haven't dealt with it sooner.

Ok, don't worry about it, the rest of it isn't urgent, just the i_size fixes for the revert - I'll try to get that out today.

#6 lore raw
Quoted 24 lines · Kent Overstreet
Quoted 23 lines · Hongbo Li
Quoted 21 lines · Kent Overstreet
Quoted 5 lines · Martin Steigerwald

Hi!

Summary: I am curious why "ls -l" reports 16 EiB as the size of a directory entry. As to what I can see the filesystem is perfectly fine.

Quoted 8 lines

Kernel 6.15, self compiled. 320 GiB BCacheFS on LUKS encrypted LVM. Checksums are xxhash. Filesystem was created recently on self compiled 6.15-rc7 with self-compiled bcachefs tools from git tag 1.25.2. "bcachefs" reports 1.25.1 as version number.

I have a directory entry that according to ls -l is quite big:

drwxrwxr-x 5 martin martin 18446744073709551400 DATE DIRECTORY

Yes, this is due to a leftover from the directory i_size patchset that had to be reverted. As long as it's not causing issues it'll be a bit before I get to it, I've got higher priority bugs I'm working on right now (as usual).

Hongbo, whatever happened to that patchset? I thought you were going to fix it so we could get it back in later?

Quoted 7 lines
Quoted 4 lines

I'm very sorry for the directory i_size problem. And this work has been postponed recently due to my other internal works. Yeah, I will get back to this work after this Dragon Boat festival. I'm really sorry I haven't dealt with it sooner.

Ok, don't worry about it, the rest of it isn't urgent, just the i_size fixes for the revert - I'll try to get that out today.

Hi, Kent,
Thank you, I noticed you have reverted the related patch. I've been to busy with some internal matters recently, but I will continue to follow up on this task.

Thanks,
Hongbo

#7 lore raw
Quoted 32 lines · Hongbo Li
Quoted 29 lines · Kent Overstreet
Quoted 27 lines · Hongbo Li
Quoted 13 lines · Kent Overstreet
Quoted 12 lines · Martin Steigerwald

Hi!

Summary: I am curious why "ls -l" reports 16 EiB as the size of a directory entry. As to what I can see the filesystem is perfectly fine.

Kernel 6.15, self compiled. 320 GiB BCacheFS on LUKS encrypted LVM. Checksums are xxhash. Filesystem was created recently on self compiled 6.15-rc7 with self-compiled bcachefs tools from git tag 1.25.2. "bcachefs" reports 1.25.1 as version number.

I have a directory entry that according to ls -l is quite big:

Quoted 8 lines
Quoted 1 line

drwxrwxr-x 5 martin martin 18446744073709551400 DATE DIRECTORY

Yes, this is due to a leftover from the directory i_size patchset that had to be reverted. As long as it's not causing issues it'll be a bit before I get to it, I've got higher priority bugs I'm working on right now (as usual).

Hongbo, whatever happened to that patchset? I thought you were going to fix it so we could get it back in later?

I'm very sorry for the directory i_size problem. And this work has been postponed recently due to my other internal works. Yeah, I will get back to this work after this Dragon Boat festival. I'm really sorry I haven't dealt with it sooner.

Quoted 7 lines
Quoted 2 lines

Ok, don't worry about it, the rest of it isn't urgent, just the i_size fixes for the revert - I'll try to get that out today.

Hi, Kent,
Thank you, I noticed you have reverted the related patch. I've been to busy with some internal matters recently, but I will continue to follow up on this task.

No rush now, let's just make sure the repair code is handling transaction restarts correctly when it comes back :)

#8 lore raw
In reply to Kent Overstreet

Kent Overstreet - 31.05.25, 01:16:04 CEST:

Quoted 8 lines
Quoted 3 lines

I have a directory entry that according to ls -l is quite big:

drwxrwxr-x 5 martin martin 18446744073709551400 DATE DIRECTORY

Yes, this is due to a leftover from the directory i_size patchset that had to be reverted. As long as it's not causing issues it'll be a bit before I get to it, I've got higher priority bugs I'm working on right now (as usual).

On 6.15.2. How can I trigger repair code from commit

bcachefs: Repair code for directory i_size

66c36452163871360f15dc4042dd00612e42cd66

?

Currently still has that odd size.

I tried "bcachefs fsck -k" so far, but so far only while filesystem is mounted, as after I dismount it I get back the device node from LVM would be busy. But I see no indication as to why.

If fsck in dismounted state would do the trick I can try disabling automatic mount on boot.

Again no priority. I do not use SSHFS on that filesystem.

I suppose I could just create a new directory and move over the files from the one with the odd size.

However, keeping as is for now. Maybe I can help testing repair code. :)

Best,

Signature · 1 line
Martin
#9 lore raw
Quoted 27 lines · Martin Steigerwald

Kent Overstreet - 31.05.25, 01:16:04 CEST:

Quoted 8 lines
Quoted 3 lines

I have a directory entry that according to ls -l is quite big:

drwxrwxr-x 5 martin martin 18446744073709551400 DATE DIRECTORY

Yes, this is due to a leftover from the directory i_size patchset that had to be reverted. As long as it's not causing issues it'll be a bit before I get to it, I've got higher priority bugs I'm working on right now (as usual).

On 6.15.2. How can I trigger repair code from commit

bcachefs: Repair code for directory i_size

66c36452163871360f15dc4042dd00612e42cd66

?

Currently still has that odd size.

I tried "bcachefs fsck -k" so far, but so far only while filesystem is mounted, as after I dismount it I get back the device node from LVM would be busy. But I see no indication as to why.

If fsck in dismounted state would do the trick I can try disabling automatic mount on boot.

Quoted 6 lines

Again no priority. I do not use SSHFS on that filesystem.

I suppose I could just create a new directory and move over the files from the one with the odd size.

However, keeping as is for now. Maybe I can help testing repair code. :)

Well, I do need to work on making the rest of the fsck passes work online, maybe I'll be able to start on that soon... fingers crossed :)

#10 lore raw

Kent Overstreet - 12.06.25, 15:45:23 CEST:

Quoted 7 lines
Quoted 5 lines

I suppose I could just create a new directory and move over the files from the one with the odd size.

However, keeping as is for now. Maybe I can help testing repair code. 🙂

Well, I do need to work on making the rest of the fsck passes work online, maybe I'll be able to start on that soon... fingers crossed 🙂

Would you like me to wait for that for testing?

I am not really in any hurry to fix this up.

Otherwise I could use the offline fsck.

Best,

Signature · 1 line
Martin
#11 lore raw
Quoted 10 lines · Martin Steigerwald

Kent Overstreet - 12.06.25, 15:45:23 CEST:

Quoted 7 lines
Quoted 5 lines

I suppose I could just create a new directory and move over the files from the one with the odd size.

However, keeping as is for now. Maybe I can help testing repair code. 🙂

Well, I do need to work on making the rest of the fsck passes work online, maybe I'll be able to start on that soon... fingers crossed 🙂

Would you like me to wait for that for testing?

No, that won't be for ~months, most likely. You'll just need offline fsck to repair this for now.

(check_inodes() shouldn't be too bad to make work online, I've just got filesystems to recover and projects to finish before I start new things)

#12 lore raw

Kent Overstreet - 12.06.25, 17:17:22 CEST:

Quoted 14 lines · Martin Steigerwald
Quoted 13 lines

Kent Overstreet - 12.06.25, 15:45:23 CEST:

Quoted 11 lines
Quoted 7 lines

I suppose I could just create a new directory and move over the files
from the one with the odd size.

However, keeping as is for now. Maybe I can help testing repair code.
🙂

Well, I do need to work on making the rest of the fsck passes work online, maybe I'll be able to start on that soon... fingers crossed 🙂

Quoted 7 lines
Quoted 1 line

Would you like me to wait for that for testing?

No, that won't be for ~months, most likely. You'll just need offline fsck to repair this for now.

(check_inodes() shouldn't be too bad to make work online, I've just got filesystems to recover and projects to finish before I start new things)

[x] done:

bcachefs (DEV): directory 4096:4294967295 with nonzero i_size 75376, fixing bcachefs (DEV): directory 4098:4294967295 with nonzero i_size -856, fixing bcachefs (DEV): directory 4675:4294967295 with nonzero i_size 960, fixing bcachefs (DEV): directory 4676:4294967295 with nonzero i_size 160, fixing bcachefs (DEV): directory 8571:4294967295 with nonzero i_size 712, fixing

Thanks.

Sizes all zero again after mounting.

Best,

Signature · 1 line
Martin