[LU-16060] e2fsck reported "symlink missing NUL terminator" errors Created: 30/Jul/22  Updated: 19/Oct/23  Resolved: 19/Aug/22

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: None
Fix Version/s: Lustre 2.16.0, Lustre 2.15.4

Type: Bug Priority: Major
Reporter: Alexander Zarochentsev Assignee: Alexander Zarochentsev
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Related
is related to LU-1540 e2fsck remove too many symlinks Resolved
Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   

e2fsck errors seen after racer test:

Symlink /REMOTE_PARENT_DIR/0x20000a73a:0xb116:0x0/CL_racer_long_01/13 (inode #275636774) is invalid.
Clear? no

Inode 275636774 is badly corrupt (badness value = 32767).  Clear? no

Symlink /REMOTE_PARENT_DIR/0x20000a73a:0xb116:0x0/CL_racer_long_01/3 (inode #275636742) is invalid.
Clear? no

Inode 275636742 is badly corrupt (badness value = 32767).  Clear? no

Symlink /REMOTE_PARENT_DIR/0x20000a73a:0xb116:0x0/CL_racer_long_01/5 (inode #275636773) is invalid.
Clear? no

Inode 275636773 is badly corrupt (badness value = 32767).  Clear? no

Symlink /REMOTE_PARENT_DIR/0x20000a73a:0xb116:0x0/CL_racer_long_01/7 (inode #275636821) is invalid.
Clear? no

Inode 275636821 is badly corrupt (badness value = 32767).  Clear? no

Also

Inode 275636742 symlink missing NUL terminator.  Fix? no

Inode 275636743 symlink missing NUL terminator.  Fix? no

Inode 275636772 symlink missing NUL terminator.  Fix? no

Inode 275636773 symlink missing NUL terminator.  Fix? no

Inode 275636774 symlink missing NUL terminator.  Fix? no

Inode 275636793 symlink missing NUL terminator.  Fix? no

Inode 275636813 symlink missing NUL terminator.  Fix? no

Inode 275636821 symlink missing NUL terminator.  Fix? no

Inode 275636826 symlink missing NUL terminator.  Fix? no

Inode 275636827 symlink missing NUL terminator.  Fix? no


 Comments   
Comment by Gerrit Updater [ 30/Jul/22 ]

"Alexander Zarochentsev <alexander.zarochentsev@hpe.com>" uploaded a new patch: https://review.whamcloud.com/48092
Subject: LU-16060 osd-ldiskfs: copy nul byte terminator in writelink
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: 36b0e0f38c0ad50d8c1cae2089ab83728c2665d3

Comment by Andreas Dilger [ 03/Aug/22 ]

This doesn't seem like a new bug. I'm pretty certain that there was a patch for e2fsck to fix this problem many years ago, and it was supposed to be phased out once osd-ldiskfs worked the same way that ext4 did. It looks like that is https://review.whamcloud.com/3560 "LU-1540 osd: add NUL terminator for long symlink".

What version of e2fsck is generating these errors? It should be handling this Is it possible that it is missing the above patch? I do recall thinking about removing this patch from the 1.46.5-wc1 rebase, but it looks like it is still in my patch series, and that rebase has not yet been landed.

Comment by Alexander Zarochentsev [ 04/Aug/22 ]

> This doesn't seem like a new bug.

Yes, it is. The new issue is about "fast" symlinks, LU-1540 is for long symlinks.
The issue is not seen till Lustre started to use extents for MDT partitions. W/o extents,
i_data gets cleared by ext4_new_inode(). But, if extents are used, i_data gets initialized by an ext4 extent structure, so symlink target string needs to be explicitly terminated by NUL byte, for short symlinks overlapping the initial ext4 extent struct.

Comment by Gerrit Updater [ 19/Aug/22 ]

"Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/48092/
Subject: LU-16060 osd-ldiskfs: copy nul byte terminator in writelink
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: 907dc0a2d333f2df2d654a968fc50f8cc05b779d

Comment by Peter Jones [ 19/Aug/22 ]

Landed for 2.16

Comment by Gerrit Updater [ 22/Aug/22 ]

"Etienne AUJAMES <eaujames@ddn.com>" uploaded a new patch: https://review.whamcloud.com/48280
Subject: LU-16060 osd-ldiskfs: copy nul byte terminator in writelink
Project: fs/lustre-release
Branch: b2_12
Current Patch Set: 1
Commit: 805ded51e0db8256f942e2105ad21abda608106d

Comment by Gerrit Updater [ 19/Jun/23 ]

"Etienne AUJAMES <eaujames@ddn.com>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/51356
Subject: LU-16060 osd-ldiskfs: copy nul byte terminator in writelink
Project: fs/lustre-release
Branch: b2_15
Current Patch Set: 1
Commit: dca31aec8847d7b27f9c2fb2f0142db6f2a6a7b5

Comment by Gerrit Updater [ 19/Oct/23 ]

"Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/51356/
Subject: LU-16060 osd-ldiskfs: copy nul byte terminator in writelink
Project: fs/lustre-release
Branch: b2_15
Current Patch Set:
Commit: d1f0ef129d8e9af13c31dc821a00639de3349873

Generated at Sat Feb 10 03:23:39 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.