]> git.baikalelectronics.ru Git - kernel.git/commit
md: replace deprecated strlcpy & remove duplicated line
authorHeming Zhao <heming.zhao@suse.com>
Fri, 1 Apr 2022 02:13:17 +0000 (10:13 +0800)
committerSong Liu <song@kernel.org>
Mon, 25 Apr 2022 21:00:36 +0000 (14:00 -0700)
commitb1e641013da06e22e16fd9808820481638e52325
treeb6b8efe0965609398103da0ab92f431d0f048361
parentce1aa74a2575b473295adf19427ce733dc334b91
md: replace deprecated strlcpy & remove duplicated line

This commit includes two topics:

1> replace deprecated strlcpy

change strlcpy to strscpy for strlcpy is marked as deprecated in
Documentation/process/deprecated.rst

2> remove duplicated strlcpy line

in md_bitmap_read_sb@md-bitmap.c there are two duplicated strlcpy(), the
history:

- commit 329b64f9e398 ("Add node recovery callbacks") introduced the first
  usage of strlcpy().

- commit 43951f81c8c1 ("Use separate bitmaps for each nodes in the cluster")
  introduced the second strlcpy(). this time, the two strlcpy() are same,
   we can remove anyone safely.

- commit c704768679d3 ("md: Skip cluster setup for dm-raid") added dm-raid
  special handling. And the "nodes" value is the key of this patch. but
  from this patch, strlcpy() which was introduced by 43951f81c8c1f
  become necessary.

- commit 4df0d8b5870a ("md: Increment version for clustered bitmaps") used
  clustered major version to only handle in clustered env. this patch
  could look a polishment for clustered code logic.

So 329b64f9e398 became useless after c704768679d3c, we could remove it
safely.

Signed-off-by: Heming Zhao <heming.zhao@suse.com>
Signed-off-by: Song Liu <song@kernel.org>
drivers/md/md-bitmap.c
drivers/md/md-cluster.c
drivers/md/md.c