1

I have a RootFS that's a read-only SquashFS overlayed with writable storage (ext4, if it matters).

This is generally working but, after a while, one file became unaccessible:

# cat  /etc/init.d/update 
[  378.714771] overlayfs: failed to get inode (-151)
[  378.719636] overlayfs: failed to get inode (-151)
cat: can't open '/etc/init.d/update': Stale NFS file handle

It seems error is in the directory entry, since i get errors even with plain ls:

# ls  /etc/init.d/update 
[ 1256.618431] overlayfs: failed to get inode (-151)
[ 1256.623489] overlayfs: failed to get inode (-151)
ls: /etc/init.d/update: Stale NFS file handle

This error seems to survive reboot.

This specific file was edited, so I have two versions, one on the "lower" SquashFS and one on the "upper" ext4; both are accessible using the respective mount points: the error seems to come from OverlayFS itself.

I seem unable to clean this error (and I'm scared because this system should go in production 24/7), I already ran fsck -fp on all affected systems (not on SquashFS, of course).

Any hint welcome.

Note: I don't have (and don't need) NFS; I assume they reused this errno (151), but I don't know.

UPDATE: I was able to clear the error by manually deleting the "new" copy of the file from the "upper" directory; subsequent editing of the same file worked as expected.

I'm very scared and I would like to understand what happened (and make sure it won't happen again in "production"!).

UPDATE2: I am using defaults for OverlayFS in my kernel v5.7, should I select more options?

   <*> Overlay filesystem support
   [ ] Overlayfs: turn on redirect directory feature by default
   [*] Overlayfs: follow redirects even if redirects are turned off
   [ ] Overlayfs: turn on inodes index feature by default
   [ ] Overlayfs: turn on metadata only copy up feature by default
ZioByte
  • 246
  • 3
  • 15
  • Are you using overlay2 or the original overlayfs? As I recall the original driver had a variety of issues leading to it being rewritten and replaced. – Michael Hampton Jul 23 '20 at 17:37
  • @MichaelHampton: I am using a fairly recent kernel: v5.7. I assume it should have latest, but it may be worth to cross check; what should I check? Was original overlayfs phased out or is it still in kernel (and i might have selected it in error)? – ZioByte Jul 23 '20 at 18:08
  • @MichaelHampton: my kernel config looks like: <*> Overlay filesystem support [ ] Overlayfs: turn on redirect directory feature by default [*] Overlayfs: follow redirects even if redirects are turned off [ ] Overlayfs: turn on inodes index feature by default [ ] Overlayfs: turn on metadata only copy up feature by default – ZioByte Jul 23 '20 at 18:11
  • Check the mount options on the mounted filesystem (with the `mount` command, of course). – Michael Hampton Jul 23 '20 at 19:08
  • @MichaelHampton: I'll do that tomorrow (I don't have the system available now), anyways mount command was quite simple: `mount -t overlay overlay -o lowerdir="/",upperdir="/overlay/upper",workdir="/overlay/workd" "/overlay/nroot", no special options.` – ZioByte Jul 23 '20 at 19:29

0 Answers0