Whamcloud - gitweb
LU-1540 e2fsck: add missing symlink NUL terminator
authorAndreas Dilger <adilger@whamcloud.com>
Sat, 14 Jul 2012 02:33:01 +0000 (20:33 -0600)
committerAndreas Dilger <adilger@whamcloud.com>
Sat, 15 Sep 2012 18:50:41 +0000 (12:50 -0600)
commit96b776f3302b950989e1a01a1eae9a6f58f5764f
tree624a5b283c511fef4b2fe460ce9c816495840d69
parenta15e46cc3d8d8462a790365e2adb4d1b82014cd4
LU-1540 e2fsck: add missing symlink NUL terminator

If a long symbolic link target is written into an external block
without a NUL terminator, its length is decided by the inode's size.
Make symlink check add a NUL termination in such cases if needed.

Such faulty symlinks were generated by osd-ldiskfs on the MDS until
Lustre 2.1.3 and Lustre 2.3.  The in-kernel code would handle such
unterminated symlinks correctly, since it used the inode size to
determine the symlink length, but e2fsck would assume the symlink
is broken if there wasn't a trailing NUL.

Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: I4419b30f1adb4a7d273796a936427aa351510213
e2fsck/e2fsck.h
e2fsck/pass1.c
e2fsck/pass2.c
e2fsck/problem.c
e2fsck/problem.h
tests/f_badsymlinks/expect.1
tests/f_badsymlinks/expect.2