ZFS: corrupted file entry is invisible, but still there somehow, nevertheless undeletabe...

From: Nils Beyer <nbe_at_vkf-renzel.de>
Date: Thu, 09 Oct 2025 11:24:04 UTC
Hi,

somehow I've gotten a corrupted file entry which I can move, rename, but
neither access nor delete due to a "Bad file descriptor":
---------------------------------- SNIP ----------------------------------
#cd /home/.broken
#ls -la broken
ls: broken: Bad file descriptor
#mv broken broken2
#ls -la broken
ls: broken: No such file or directory
#ls -la broken2
ls: broken2: Bad file descriptor
#rm broken2
rm: broken2: Bad file descriptor
---------------------------------- SNIP ----------------------------------


When I use "zdb" to show details of that file entry, it seems that the
file mode is borked:
---------------------------------- SNIP ----------------------------------
root@asbach:/home/.broken/#zdb -v -O asbach home/.broken/broken2

     Object  lvl   iblk   dblk  dsize  dnsize  lsize   %full  type
    2177228    2   128K   128K    96K     512   256K  100.00  ZFS plain file
                                                168   bonus  System attributes
         dnode flags: USED_BYTES USERUSED_ACCOUNTED USEROBJUSED_ACCOUNTED
         dnode maxblkid: 1
         uid     1001
         gid     0
         atime   Thu Jan 28 11:30:06 2021
         mtime   Thu Jan 28 11:30:06 2021
         ctime   Thu Oct  9 13:14:09 2025
         crtime  Thu Jan 28 11:30:06 2021
         gen     30981142
         mode    1777777740002404560170
         size    150528
         parent  16499
         links   1
         pflags  40800000104
---------------------------------- SNIP ----------------------------------

Do I have any possibility to fix that?



TIA and regards,
Nils