Symptoms
ext4 errors are registered in `/var/log/messages` for the pfcache ploop device:
[233080.729202] EXT4-fs error (device ploop46148p1): ext4_add_entry: bad entry in directory #393291: rec_len is smaller than minimal - block=1581114offset=0(0), inode=0, rec_len=0, name_len=0
[233080.729582] EXT4-fs error (device ploop46148p1): ext4_add_entry: bad entry in directory #393354: rec_len is smaller than minimal - block=1581127offset=0(0), inode=0, rec_len=0, name_len=0
[233080.729993] EXT4-fs error (device ploop46148p1): ext4_add_entry: bad entry in directory #393291: rec_len is smaller than minimal - block=1581114offset=0(0), inode=0, rec_len=0, name_len=0
# cat /proc/mounts | grep ploop46148p1
/dev/ploop46148p1 /vz/pfcache ext4 rw,relatime,barrier=1,data=ordered,balloon_ino=12 0 0
Resolution
Follow these steps to perform ext4 file system check on the pfcache partition:
1. Stop pfcache service:
# systemctl stop pfcached.service
2. Remount all ploop devices without pfcache option:
# cat /proc/mounts | grep pfcache= /dev/ploop57184p1 /vz/root/103 ext4 rw,relatime,barrier=1,data=ordered,balloon_ino=12,pfcache_csum,pfcache=/vz/pfcache 0 0
/dev/ploop24447p1 /vz/root/104 ext4 rw,relatime,barrier=1,data=ordered,balloon_ino=12,pfcache_csum,pfcache=/vz/pfcache 0 0
# cat /proc/mounts | grep pfcache= | awk '{print $1" "$2}' | while read ploop mpoint ; do mount -t ext4 -o remount,nopfcache $ploop $mpoint ; done
# cat /proc/mounts | grep pfcache=
...there should be no output here...
3. Get the exact ID of the pfcache ploop device partition:
# cat /proc/mounts | grep /vz/pfcache /dev/ploop46148p1 /vz/pfcache ext4 rw,relatime,barrier=1,data=ordered,balloon_ino=12 0 0
4. Unmount the partition:
# systemctl stop pfcached-mount.service
5. Perform the file system check:
# e2fsck /dev/ploop46148p1
6. Mount the partition back:
# systemctl start pfcached-mount.service
7. Remount all ploop devices with pfcache:
# cat /proc/mounts | grep ploop | grep -v '/vz/pfcache'
/dev/ploop57184p1 /vz/root/103 ext4 rw,relatime,barrier=1,data=ordered,balloon_ino=12,pfcache_csum 0 0
/dev/ploop24447p1 /vz/root/104 ext4 rw,relatime,barrier=1,data=ordered,balloon_ino=12,pfcache_csum 0 0
# cat /proc/mounts | grep ploop | grep -v '/vz/pfcache' | awk '{print $1" "$2}' | while read ploop mpoint ; do mount -t ext4 -o remount,pfcache=/vz/pfcache $ploop $mpoint ; done
# cat /proc/mounts | grep pfcache= /dev/ploop57184p1 /vz/root/103 ext4 rw,relatime,barrier=1,data=ordered,balloon_ino=12,pfcache_csum,pfcache=/vz/pfcache 0 0
/dev/ploop24447p1 /vz/root/104 ext4 rw,relatime,barrier=1,data=ordered,balloon_ino=12,pfcache_csum,pfcache=/vz/pfcache 0 0
8. Start pfcache service:
# systemctl start pfcached.service