Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp954681ybz; Wed, 15 Apr 2020 23:22:11 -0700 (PDT) X-Google-Smtp-Source: APiQypLZi2K/orhOn2MgKR8XhXLo8+L10SNuhjVP3QE71/dHye4qbl/jDFe8uGlS5zSR8fUVawx1 X-Received: by 2002:a17:907:4420:: with SMTP id om24mr7732354ejb.99.1587018131105; Wed, 15 Apr 2020 23:22:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587018131; cv=none; d=google.com; s=arc-20160816; b=u0MujqtTtSFsBfhoi0AvgLjuLVujuxFfE+3ihUxyh2LsB9alTED7dBOdmM+UZINEdf 8ftiI4wLC2l7zuWfCwChsjMjvdSjbydaHUn2qH/kJmtWQv6CAWUXhW69uXybike4u4VE mrKybl7byfd35fFmQw7TIx9kFoJgFGqvf0pCCCbFv05fycUoIgwafBH5yeH1zTq0yfzF tCP6m0y4nJ6J1Jo7/keEaEAzuCB025l79PQBbIaX5kojFo1bpp8xBa6Q7t/J1fhJtS4R 3DxiNI/QiaXaXkJQ8mRu447ak0Rq9ERCLTBt53IV3eJXNKJMWcUdhFiVnYsiUue4GWS2 i4dA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dmarc-filter:dkim-signature; bh=Z2cB104A3VarQK23oJ8oGoWJI/nVp7NdgHxvhORaQVM=; b=rwiClq8rFVCBMkrY9Vxgh3nciij7AaDFLQnU4HNp47fdgdMr5S8CcSh/dkO/W8kYxQ b8TVx7VHgm7/hXqD7RE5BxZ65kCKVSnAWNZ6Bpkibo1b1p3G54tBIuvH1ZKMAY1shNqJ +7O6yxc0NyhB5lVMxiU3bTJwtQCcJESC//80pcuP6NE4dTsgWCJS1PzC5rdphoinYJx/ 5T/5gRUqyRXz9KnL8r554LeOoKlzlDtE/XxsI90isErufz2oUhSBamyoYFWRZCPUBIi/ z2Wwwj2fyewIY55qrARbAQwGca+EiPFQv+U09GMA01rubt0GR4oOLKLEfvLBF2RO86/Z G4CA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b=KqSX5xR3; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g6si11256624edp.283.2020.04.15.23.21.46; Wed, 15 Apr 2020 23:22:11 -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=fail header.i=@mg.codeaurora.org header.s=smtp header.b=KqSX5xR3; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2407804AbgDPGSC (ORCPT + 99 others); Thu, 16 Apr 2020 02:18:02 -0400 Received: from mail26.static.mailgun.info ([104.130.122.26]:12870 "EHLO mail26.static.mailgun.info" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2407332AbgDPGR4 (ORCPT ); Thu, 16 Apr 2020 02:17:56 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1587017875; h=Message-Id: Date: Subject: Cc: To: From: Sender; bh=Z2cB104A3VarQK23oJ8oGoWJI/nVp7NdgHxvhORaQVM=; b=KqSX5xR3xvzKr13Lr/2Lm0j27V152GjO83fiDYFdINttVGn2+7SzFB1jVCK3E8U962YdGkoR rWiWkMwhfvExEv/vQtvTHl5dJljLjNEhPZlxJW+JjSEtlODAEHMmP5uhCQDGpLWN6w2EHnVs zYF2NRFAT8ZGyPCzAMwIrvkA9i4= X-Mailgun-Sending-Ip: 104.130.122.26 X-Mailgun-Sid: WyI0MWYwYSIsICJsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by mxa.mailgun.org with ESMTP id 5e97f892.7fe93db26928-smtp-out-n05; Thu, 16 Apr 2020 06:17:54 -0000 (UTC) Received: by smtp.codeaurora.org (Postfix, from userid 1001) id DC998C44788; Thu, 16 Apr 2020 06:17:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=2.0 tests=ALL_TRUSTED,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.0 Received: from codeaurora.org (blr-c-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: stummala) by smtp.codeaurora.org (Postfix) with ESMTPSA id 5BA3BC433F2; Thu, 16 Apr 2020 06:17:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 5BA3BC433F2 Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=none smtp.mailfrom=stummala@codeaurora.org From: Sahitya Tummala To: Jaegeuk Kim , Chao Yu , linux-f2fs-devel@lists.sourceforge.net Cc: Sahitya Tummala , linux-kernel@vger.kernel.org Subject: [PATCH] f2fs: Fix the accounting of dcc->undiscard_blks Date: Thu, 16 Apr 2020 11:47:41 +0530 Message-Id: <1587017861-6454-1-git-send-email-stummala@codeaurora.org> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When a discard_cmd needs to be split due to dpolicy->max_requests, then for the remaining length it will be either merged into another cmd or a new discard_cmd will be created. In this case, there is double accounting of dcc->undiscard_blks for the remaining len, due to which it shows incorrect value in stats. Signed-off-by: Sahitya Tummala --- fs/f2fs/segment.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index 728ff6e..1c48ec8 100644 --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c @@ -1214,8 +1214,10 @@ static int __submit_discard_cmd(struct f2fs_sb_info *sbi, len = total_len; } - if (!err && len) + if (!err && len) { + dcc->undiscard_blks -= len; __update_discard_tree_range(sbi, bdev, lstart, start, len); + } return err; } -- Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center, Inc. Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project.