]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
mkfs.xfs: null-terminate symlinks created via protofile
authorEric Sandeen <sandeen@redhat.com>
Wed, 12 Dec 2018 17:42:40 +0000 (11:42 -0600)
committerEric Sandeen <sandeen@redhat.com>
Wed, 12 Dec 2018 17:42:40 +0000 (11:42 -0600)
commit153d2ff9bb3c2b4013723f61ba32cb990667678b
tree6679e5bd69484a346761abaa6da0d271b05e0081
parent80afe23448aed533bc66923c627fbea82716de76
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
failed with:

 Metadata corruption detected at 0x101214a, inode 0x89 data fork

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reported-by: Zorro Lang <zlang@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
libxfs/libxfs_api_defs.h
mkfs/proto.c