Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp367947pxf; Wed, 17 Mar 2021 07:07:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyTnuG070izwr9KNsdebQY4jiADv0vKCegZk+jkrQ7lawT4/ZK6IZGKXmY77PL1S+n7B0Mw X-Received: by 2002:a5d:4d09:: with SMTP id z9mr4512316wrt.426.1615990065375; Wed, 17 Mar 2021 07:07:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615990065; cv=none; d=google.com; s=arc-20160816; b=UrCBeP5Eu3SdHPagi54yeRCPYL26z1WnWywG1IEtXK84CAuEAOxKVNFMbn7CYS/NAV PcxpAtkl64iSFoGH6eZuF8PwMN/hraQpzQlAXwLysDDEcDbkkPkDprLhqeDNECsamzE/ bZRvDcyprDlBlgOuqUMlXVrQFh+zte4IQ5CRRBDI9Oh45vgZoR93qs1Yj1ck6HkLmg7B XRmc13vTgenmZuNkMadlu7CFXsd//oFLy+RDS1ZC+3HlVcD+mznELmNw2ePrRRHXsIIj jHYNaUbuGfavy3ME5DQoLpErg3TkvBLMbib5FXwOrDZeYEyxtUc6VNiOvNsI76mqN25A sMhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from :dkim-signature; bh=PWoltp9WmwyO3d7XhliVywf9i2GXKDnsLpbRrO2NbGI=; b=kC9D3fCBcMGsEZY6vDICT74yZUVI/eaAuClS/TNcKQYlExiai5t/LUGoz4kOZFmdHT DpUG7n3ABcOFp11S4fV3feDrdE8KTJjwpc1URoJE11zMNlSffS472RJEBk8UbZ0VEIWB JSsC2pMsFmRkaNyXqWm6Ip1DJ4HrwMKUo35yN5g09+HGPExNp9Kg2UzC7rlY8EeMc6hE M3k/jPm+7rivXGz6jSO81iOGgSkTtBCKWf0B/9702V/ZUJjlR8NVCbEot/bA5uRq+UiS kJeHrRi/gHYTUCFDUxs7omNQA1zA2oCo0yoPCliGO0S1rGe4al2deHv/ocd61ltkVFFp PsCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@digitalocean.com header.s=google header.b=WsRpNG8s; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=digitalocean.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u5si17351468ejf.438.2021.03.17.07.07.20; Wed, 17 Mar 2021 07:07:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@digitalocean.com header.s=google header.b=WsRpNG8s; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=digitalocean.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231558AbhCQOFg (ORCPT + 99 others); Wed, 17 Mar 2021 10:05:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49824 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231390AbhCQOFN (ORCPT ); Wed, 17 Mar 2021 10:05:13 -0400 Received: from mail-qv1-xf29.google.com (mail-qv1-xf29.google.com [IPv6:2607:f8b0:4864:20::f29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9C494C06174A for ; Wed, 17 Mar 2021 07:05:12 -0700 (PDT) Received: by mail-qv1-xf29.google.com with SMTP id dc12so495038qvb.4 for ; Wed, 17 Mar 2021 07:05:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=digitalocean.com; s=google; h=from:to:cc:subject:date:message-id; bh=PWoltp9WmwyO3d7XhliVywf9i2GXKDnsLpbRrO2NbGI=; b=WsRpNG8sX0PGjK+pfA+SQ3Bb3jhflsFaBhjj63LbczCkJ+7RcnSs60BJC1XVRTzffh ROYiVgrbr2NmfFs/FGJdGvIW460RaXjSJ7qb5vOugINIc9EiS1DXbtJFe0WYDSAPHGlA HQ4SiZdhN07sZRsTsJtQi+VtW6bA1Cr6v/QjY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=PWoltp9WmwyO3d7XhliVywf9i2GXKDnsLpbRrO2NbGI=; b=ijOwIDMVDPlFAv21u7IxmoHsByym9P5TFBTo4PSQb6ax6WXonr2M3lYIizdNTLMcyp r5cEmJqsZTGrW6f0rzzMNnoKQvMTE4EZv/B7GcDJBz8XLMfzF7r/zo24VOaNalmUvo+v SjRPGVbnsL2gei0tC36h5RCYiPF7K+SzSTldFktTrsIfZkmphZ5Y/0PTEl54t3o8kJE5 5/ArBU8u9u6NRPT2p3fu03+FJCZHTadNZiqOfyNNNqr+5/u53QcP/tHd1XcKb8EGDQo8 KxaBJd5X745DT4oxP3MJu/ItiTC2nUm43IZMutg6kL7whf4lESZjleJ8ImcR+gWyw7lU WC3A== X-Gm-Message-State: AOAM532/6JE20t9ys2q/L3CaaEioqw+kJkzYJElouRrKgsbwClYhJLAJ jXtL12jo2ugOxXFth/r8dNE+fg== X-Received: by 2002:a0c:a909:: with SMTP id y9mr5600566qva.20.1615989911862; Wed, 17 Mar 2021 07:05:11 -0700 (PDT) Received: from tuna.fritz.box ([2a02:8070:87b9:f700:d43d:6bf:d9e5:58a3]) by smtp.gmail.com with ESMTPSA id e3sm17864791qkn.39.2021.03.17.07.05.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Mar 2021 07:05:11 -0700 (PDT) From: Jan Glauber To: linux-raid@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Song Liu , Jan Glauber Subject: [PATCH] md: Fix missing unused status line of /proc/mdstat Date: Wed, 17 Mar 2021 15:04:39 +0100 Message-Id: <20210317140439.9499-1-jglauber@digitalocean.com> X-Mailer: git-send-email 2.17.1 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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: Don't return NULL immediately in start() for v=2 but call show() once to print the status line also for multiple reads. Fixes: 1f4aace60b0e ("fs/seq_file.c: simplify seq_file iteration code and interface") Signed-off-by: Jan Glauber --- drivers/md/md.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/md/md.c b/drivers/md/md.c index 21da0c48f6c2..cb19d50fa672 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -8153,7 +8153,11 @@ static void *md_seq_start(struct seq_file *seq, loff_t *pos) loff_t l = *pos; struct mddev *mddev; - if (l >= 0x10000) + if (l == 0x10000) { + ++*pos; + return (void *)2; + } + if (l > 0x10000) return NULL; if (!l--) /* header */ -- 2.17.1