Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1621933ybv; Fri, 21 Feb 2020 00:27:47 -0800 (PST) X-Google-Smtp-Source: APXvYqxqgZVyaji4OzM6EECJYCGM/mHn415IZdNi50/xWjbF2ihNVnsA2Y22wAZzw0pJiemN6oHQ X-Received: by 2002:a05:6830:1e86:: with SMTP id n6mr27506082otr.321.1582273667369; Fri, 21 Feb 2020 00:27:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582273667; cv=none; d=google.com; s=arc-20160816; b=bWfhfauTggnJxDv0hDqw+UH46jeCYeqxqRmchoHLdb6C2nY4ZiGQzp5aOVjFXYlWuy +xgd/35Rqp8S/yBjCZnWIVbvhBdV2r8Nl/diU9hLwsAo+WrptxqWSb4hMPkH1kQTtVdw gixA9FpoNbZGubfyEmN7jJ7XRSRoH+U1vNFA8Ubgr+cChCuUeSmjXFeSEn8rBGKaRYJc 643fvNLJfuAu2CNaYusotT3fvsoUn3PZxbFHvVYaPDfZrR/GwmHu06MgGz709ufCx7SU 2V9kwwRQhYyielVFYXfIpwDea5LlxuS7xYYhRC6n1hDefn89ni4u+dRxq5Hb5KNHAcTQ 7Tpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=k36TYmu5bwp/69+KrbePTxfTrJvQdh/qqOpxEkEjGVg=; b=gLNlTzvR4Plkl/F4zusHTS+ZW7GLhupFUKaMH9OqxnowvRTLyf3elCezJtariWUFgQ WckOOa5xrByfV5mgNSK8NJ9x+rfOR2esud9ijAhWOf2+WorBIQp0Ua8DFDLwJPTTnF+Y 3eYvwvQaF6Vs46tDtoYn55hrd2fpGTKEEjtUbp1yPXC17GodTFr/Wq+vlLJ4N3moGVQ3 7AiLhkafAtou9I8+WGeFZ/QkaMWZbWZ6ArfUAaxpur26nFTjSaixDE4MyVof94wqsF6W P1nNaFLkBBGJbW2yxuyjheER32uDnelaDskYGhoxW3Rzb/pdROJ71oBEEwR+E2g3Mh3P QG4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=THU0b81W; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f62si492165oib.131.2020.02.21.00.27.35; Fri, 21 Feb 2020 00:27:47 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=THU0b81W; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388216AbgBUIW4 (ORCPT + 99 others); Fri, 21 Feb 2020 03:22:56 -0500 Received: from mail.kernel.org ([198.145.29.99]:34666 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388376AbgBUIWx (ORCPT ); Fri, 21 Feb 2020 03:22:53 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3DF342469D; Fri, 21 Feb 2020 08:22:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582273372; bh=LO9osZihFUTbpG6o//SCjgXWqG9dLGPwwMhlrka+frI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=THU0b81WdrI00j90vi0oBVOhfUVnrDo4UKbdOcoDCCJXDrKk6gNyTIC+A9hXskGlm HqbYTEfT5E/MYdGsg/azPYN0XhOitumEdWYOH8QjAbU6rYLIFZpW9XOhk4hwL/aKul afTUCkc8rMTPU5vbTGmagYKE8t9VNuRAGsg2zIRI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, philip@philip-seeger.de, Josef Bacik , Anand Jain , David Sterba , Sasha Levin Subject: [PATCH 4.19 146/191] btrfs: device stats, log when stats are zeroed Date: Fri, 21 Feb 2020 08:41:59 +0100 Message-Id: <20200221072308.109191972@linuxfoundation.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200221072250.732482588@linuxfoundation.org> References: <20200221072250.732482588@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Anand Jain [ Upstream commit a69976bc69308aa475d0ba3b8b3efd1d013c0460 ] We had a report indicating that some read errors aren't reported by the device stats in the userland. It is important to have the errors reported in the device stat as user land scripts might depend on it to take the reasonable corrective actions. But to debug these issue we need to be really sure that request to reset the device stat did not come from the userland itself. So log an info message when device error reset happens. For example: BTRFS info (device sdc): device stats zeroed by btrfs(9223) Reported-by: philip@philip-seeger.de Link: https://www.spinics.net/lists/linux-btrfs/msg96528.html Reviewed-by: Josef Bacik Signed-off-by: Anand Jain Reviewed-by: David Sterba Signed-off-by: David Sterba Signed-off-by: Sasha Levin --- fs/btrfs/volumes.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 5bbcdcff68a9e..9c3b394b99fa2 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c @@ -7260,6 +7260,8 @@ int btrfs_get_dev_stats(struct btrfs_fs_info *fs_info, else btrfs_dev_stat_reset(dev, i); } + btrfs_info(fs_info, "device stats zeroed by %s (%d)", + current->comm, task_pid_nr(current)); } else { for (i = 0; i < BTRFS_DEV_STAT_VALUES_MAX; i++) if (stats->nr_items > i) -- 2.20.1