md: Fix missing unused status line of /proc/mdstat
authorJan Glauber <jglauber@digitalocean.com>
Wed, 17 Mar 2021 14:04:39 +0000 (15:04 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 14 May 2021 07:49:59 +0000 (09:49 +0200)
commit0035a4704557ba66824c08d5759d6e743747410b
tree01fd7d63710658b3cc8e0a5db9bbe91e102774bf
parentb70b7ec500892f8bc12ffc6f60a3af6fd61d3a8b
md: Fix missing unused status line of /proc/mdstat

commit 7abfabaf5f805f5171d133ce6af9b65ab766e76a upstream.

Reading /proc/mdstat with a read buffer size that would not
fit the unused status line in the first read will skip this
line from the output.

So 'dd if=/proc/mdstat bs=64 2>/dev/null' will not print something
like: unused devices: <none>

Don't return NULL immediately in start() for v=2 but call
show() once to print the status line also for multiple reads.

Cc: stable@vger.kernel.org
Fixes: 1f4aace60b0e ("fs/seq_file.c: simplify seq_file iteration code and interface")
Signed-off-by: Jan Glauber <jglauber@digitalocean.com>
Signed-off-by: Song Liu <songliubraving@fb.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/md/md.c