[Bug 270632] [ext2fs] files <4096 bytes are corrupted on ext4 filesystems

From: <bugzilla-noreply_at_freebsd.org>
Date: Sat, 08 Apr 2023 00:25:46 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=270632

--- Comment #4 from Rajeev Pillai <rajeev_v_pillai@yahoo.com> ---
I don't think the type of drive matters. Here's the result on:

```
$ uname -a
FreeBSD x202e.localdomain 13.1-RELEASE-p6 FreeBSD 13.1-RELEASE-p6 GENERIC amd64
$ 
```

Using an md(4) device as you have:

```
root@x202e:/tmp # mdconfig -s 512M
md0
root@x202e:/tmp # mke2fs -t ext4 /dev/md0
mke2fs 1.47.0 (5-Feb-2023)
Creating filesystem with 131072 4k blocks and 32768 inodes
Filesystem UUID: 72469c07-7520-4c45-ae18-4a0129c7300b
Superblock backups stored on blocks: 
        32768, 98304

Allocating group tables: done                            
Writing inode tables: done                            
Creating journal (4096 blocks): done
Writing superblocks and filesystem accounting information: done

root@x202e:/tmp # mount -t ext2fs /dev/md0 /mnt
root@x202e:/tmp # echo 'hello world' >/mnt/a.txt
root@x202e:/tmp # ed -s /mnt/a.txt <<\EoF
> 1s/./&/
> wq
> EoF
root@x202e:/tmp # cat /mnt/a.txt
hello world
root@x202e:/tmp # umount /mnt
root@x202e:/tmp # mount -r -t ext2fs /dev/md0 /mnt
root@x202e:/tmp # hd /mnt/a.txt 
00000000  00 00 00 00 00 00 00 00  00 00 00 00              |............|
0000000c
root@x202e:/tmp # 
```

I will try with the latest -CURRENT snapshot tomorrow.

-- 
You are receiving this mail because:
You are the assignee for the bug.