koverstreet / bcachefs

Other
708 stars 73 forks source link

bcachefs does not appear to play well with overlay (RENAME_WHITEOUT req) #635

Open rubiksdot opened 10 months ago

rubiksdot commented 10 months ago

Recently moved my container set up from ##btrfs to bcachefs and noticed that my container for compiling stuff was failing to compile stuff. The simplified instance of the failure is this:

$ # bcachefs:
$ ll /etc/init.d/udev*
8 -rwxr-xr-x 1 root root 6871 Nov  9 23:46 /etc/init.d/udev
$ mv /etc/init.d/udev /etc/init.d/udev.dpkg-remove
mv: cannot move '/etc/init.d/udev' to a subdirectory of itself, '/etc/init.d/udev.dpkg-remove'
$ ll /etc/init.d/udev*
8 -rwxr-xr-x 1 root root 6871 Nov  9 23:46 /etc/init.d/udev

I copied the underlying filesystem to ext4 and tried there:

# ext4:
$ ll /etc/init.d/udev*
8 -rwxr-xr-x 1 root root 6871 Nov  9 23:46 /etc/init.d/udev
$ mv /etc/init.d/udev /etc/init.d/udev.dpkg-remove
$ ll /etc/init.d/udev*
8 -rwxr-xr-x 1 root root 6871 Nov  9 23:46 /etc/init.d/udev.dpkg-remove

The underlying filesystem was previously btrfs and compilation worked there.

Some extra details in case they matter:

# grep BCACHE /boot/config
CONFIG_BCACHE=y
# CONFIG_BCACHE_DEBUG is not set
# CONFIG_BCACHE_ASYNC_REGISTRATION is not set
CONFIG_FS_MBCACHE=y
CONFIG_BCACHEFS_FS=y
CONFIG_BCACHEFS_QUOTA=y
CONFIG_BCACHEFS_ERASURE_CODING=y
CONFIG_BCACHEFS_POSIX_ACL=y
# CONFIG_BCACHEFS_DEBUG_TRANSACTIONS is not set
# CONFIG_BCACHEFS_DEBUG is not set
# CONFIG_BCACHEFS_TESTS is not set
# CONFIG_BCACHEFS_LOCK_TIME_STATS is not set
# CONFIG_BCACHEFS_NO_LATENCY_ACCT is not set
$ bcachefs show-super <bcachefs fs device in question>
External UUID:                              168b7a63-d9a4-4098-a3b8-7c4a294a2edd
Internal UUID:                              880186df-9903-42bc-9a01-ba7f4d1601c3
Device index:                               0
Label:                                      podland
Version:                                    1.3: rebalance_work
Version upgrade complete:                   1.3: rebalance_work
Oldest version on disk:                     1.3: rebalance_work
Created:                                    Wed Jan 10 13:06:29 2024
Sequence number:                            24
Superblock size:                            4536
Clean:                                      1
Devices:                                    1
Sections:                                   members_v1,replicas_v0,clean,journal_v2,counters,members_v2,errors
Features:                                   lz4,gzip,reflink,new_siphash,inline_data,new_extent_overwrite,btree_ptr_v2,reflink_inline_data,new_varint,journal_no_flush,alloc_v2,extents_across_btree_nodes
Compat features:                            alloc_info,alloc_metadata,extents_above_btree_updates_done,bformat_overflow_done

Options:
  block_size:                               4.00 KiB
  btree_node_size:                          256 KiB
  errors:                                   continue [ro] panic 
  metadata_replicas:                        1
  data_replicas:                            1
  metadata_replicas_required:               1
  data_replicas_required:                   1
  encoded_extent_max:                       64.0 KiB
  metadata_checksum:                        none crc32c [crc64] xxhash 
  data_checksum:                            none crc32c [crc64] xxhash 
  compression:                              none
  background_compression:                   gzip:9
  str_hash:                                 crc32c crc64 [siphash] 
  metadata_target:                          none
  foreground_target:                        none
  background_target:                        none
  promote_target:                           none
  erasure_code:                             0
  inodes_32bit:                             1
  shard_inode_numbers:                      1
  inodes_use_key_cache:                     1
  gc_reserve_percent:                       8
  gc_reserve_bytes:                         0 B
  root_reserve_percent:                     0
  wide_macs:                                0
  acl:                                      1
  usrquota:                                 0
  grpquota:                                 0
  prjquota:                                 0
  journal_flush_delay:                      1000
  journal_flush_disabled:                   0
  journal_reclaim_delay:                    100
  journal_transaction_names:                1
  version_upgrade:                          [compatible] incompatible none 
  nocow:                                    0

members_v2 (size 136):
  Device:                                   0
    Label:                                  (none)
    UUID:                                   7a771923-4065-4fab-b013-e382c39f8df2
    Size:                                   128 GiB
    read errors:                            0
    write errors:                           0
    checksum errors:                        0
    seqread iops:                           0
    seqwrite iops:                          0
    randread iops:                          0
    randwrite iops:                         0
    Bucket size:                            256 KiB
    First bucket:                           0
    Buckets:                                524288
    Last mount:                             Sat Jan 20 19:59:57 2024
    State:                                  rw
    Data allowed:                           journal,btree,user
    Has data:                               journal,btree,user
    Discard:                                0
    Freespace initialized:                  1

replicas_v0 (size 24):
  btree: 1 [0] journal: 1 [0] user: 1 [0]

If there's any other info required, please shout.

koverstreet commented 10 months ago

Known issue - we don't have RENAME_WHITEOUT yet.

rubiksdot commented 10 months ago

Ta. I'll keep that one btrfs for now, then.

daurnimator commented 10 months ago

I had an attempt at this, pushed to my branch at https://github.com/daurnimator/linux/tree/bcachefs-rename_whiteout