mkfs.xfs: null-terminate symlinks created via protofile
Now that we have a symlink verifier which checks that in-memory
symlink names are null-terminated, be sure we do that when we
create them via the mkfs protofile.
We only want to null-terminate inline data if it's a symlink;
we only ever /call/ newfile() with "dolocal" for symlinks, so
rename that function argument for clarity.
Then, rather than open-coding all this, just call
xfs_init_local_fork which handles it properly.
Zorro found this by running xfs/019 on an s390x machine, it
Metadata corruption detected at 0x101214a, inode 0x89 data fork
Signed-off-by: Eric Sandeen <firstname.lastname@example.org>
Reported-by: Zorro Lang <email@example.com>
Reviewed-by: Darrick J. Wong <firstname.lastname@example.org>
Signed-off-by: Eric Sandeen <email@example.com>
2 files changed