fs/xfs: replace strncpy with memtostr_pad()
authorPranav Tyagi <pranav.tyagi03@gmail.com>
Fri, 4 Jul 2025 10:12:50 +0000 (15:42 +0530)
committerCarlos Maiolino <cem@kernel.org>
Thu, 24 Jul 2025 15:30:14 +0000 (17:30 +0200)
commitf4a3f01e8e451fb3cb444a95a59964f4bc746902
tree010bd9c34153e3c15b722dcc9f201e37ccaa735b
parent8c10b04f9fc1760cb79068073686d8866e59d40f
fs/xfs: replace strncpy with memtostr_pad()

Replace the deprecated strncpy() with memtostr_pad(). This also avoids
the need for separate zeroing using memset(). Mark sb_fname buffer with
__nonstring as its size is XFSLABEL_MAX and so no terminating NULL for
sb_fname.

Signed-off-by: Pranav Tyagi <pranav.tyagi03@gmail.com>
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
fs/xfs/libxfs/xfs_format.h
fs/xfs/xfs_ioctl.c