]> git.ipfire.org Git - thirdparty/grub.git/commit
fs/ext2: Fix a file not found error when a symlink filesize is equal to 60
authorYi Zhao <yi.zhao@windriver.com>
Fri, 8 Jan 2021 00:39:47 +0000 (08:39 +0800)
committerDaniel Kiper <daniel.kiper@oracle.com>
Wed, 10 Mar 2021 12:14:25 +0000 (13:14 +0100)
commitbd8b36d8aadbfad14604570540e76d52162c816a
tree2dd7d45797bd6ce1b1d894f4a16c475379998b3b
parent8fcfd1e0fc72d58766ce3dc09cf883c032f063f6
fs/ext2: Fix a file not found error when a symlink filesize is equal to 60

We encountered a file not found error when the symlink filesize is
equal to 60:

  $ ls -l initrd
  lrwxrwxrwx 1 root root 60 Jan  6 16:37 initrd -> secure-core-image-initramfs-5.10.2-yoctodev-standard.cpio.gz

When booting, we got the following error in the GRUB:

  error: file `/initrd' not found

The root cause is that the size of diro->inode.symlink is equal to 60
and a symlink name has to be terminated with NUL there. So, if the
symlink filesize is exactly 60 then it is also stored in a separate
block rather than in the inode itself.

Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
grub-core/fs/ext2.c