linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* md: dead code in md_alloc()
@ 2018-09-20 16:03 Andrey Ryabinin
  0 siblings, 0 replies; only message in thread
From: Andrey Ryabinin @ 2018-09-20 16:03 UTC (permalink / raw)
  To: NeilBrown, Shaohua Li; +Cc: Kirill Tkhai, linux-raid, linux-kernel

Hi,
Kirill noticed that the following piece of code from md_alloc(dev, name)
is dead:
	if (name && dev)
		/*
		 * Creating /dev/mdNNN via "newarray", so adjust hold_active.
		 */
		mddev->hold_active = UNTIL_STOP;

md_alloc() is always called with either dev == 0 or name == NULL.

Judging from the commit that added this code:

039b7225e6e98783a7a7e79c52b29c437f29967d
Author: NeilBrown <neilb@suse.com>
Date:   Wed Apr 12 16:26:13 2017 +1000

    md: allow creation of mdNNN arrays via md_mod/parameters/new_array

and from the comment, it seems should be "if (!name && dev)".
But that would also change ->hold_active for created-by-open md devices,
and I'm not sure whether that would be a desirable change or not.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-09-20 16:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-20 16:03 md: dead code in md_alloc() Andrey Ryabinin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).