Received: by 2002:ac0:e34a:0:0:0:0:0 with SMTP id g10csp720963imn; Tue, 26 Jul 2022 07:37:04 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vQ+a/W3IZsGgJed5aVQqH5YpdmXJ1eiL8lKeC3sAEViUuOE+qAN2qYoziSx4rn2H6U5ow1 X-Received: by 2002:a17:902:b612:b0:16c:7e2d:ff39 with SMTP id b18-20020a170902b61200b0016c7e2dff39mr16488283pls.111.1658846224457; Tue, 26 Jul 2022 07:37:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658846224; cv=none; d=google.com; s=arc-20160816; b=HDZXjfvkIYtixS/N4bVXMUNTNwsyaA54JCNqfEPy4BM3z2ARkLwJryZJKvgf7CGOKa 5IaorLft2okVplnFKuTmvME4dlaWzpfFJHwy6csV07GK2PTzBCGVIelJ3wTKb69WN8Eb zmpof5yNonSCNoefCtYD0/634jAerrvEVBb2Zzh+89PZowpNy9Lw3JPAs+d90gV9VGBf xzLO57vk+cqzT/wc4SaKRRkGS8fpWw24DitSCEjno/3AOnmlgKq5N6kgVcIo3QJAjxbt 0b4zMDP3a58PaBSY70wvctaS9djiSLLtny/Kji91s8RYZFD2UxZa8EOlavpUTB965xYL yGgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=m6KdYVFGUbU6VdoR9jLjv+Ul8sm1sD6C1+E8PC41iJU=; b=z8FVkmC6fqZUpjDl6LmERxNEBVRY5TqzFKISt/pKtgjLTSPwHNdraW9JEbAEdN4K6E gl3I/T8BJyDzBTl5l6fRRprYkR2/PNJk+8thg+swcBx2dYeyq4LPhuUShjlQU+ZXs6KU iBEr+cqb0T0APo7DriHVJcLtoLiCDUfKNG0bovA3EVUiFFF0vA/IO8rnngwydKyRQ/OP YbxcjEh2sm62vtQ/MWROd+ZnwQw+6ZUDXlBc5WS8bTD11dowXUrjHqNT7P895PApj+lN 0MQZoRHSJNSteU7mu6MkeOc1nWIJYksboBMCZMUeH76UZWyiePkzUci6jCSa4lMzQZsN M+0g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e3-20020a631e03000000b004160cd8ed17si17314451pge.680.2022.07.26.07.36.46; Tue, 26 Jul 2022 07:37:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239324AbiGZO3o (ORCPT + 99 others); Tue, 26 Jul 2022 10:29:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37998 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238934AbiGZO3i (ORCPT ); Tue, 26 Jul 2022 10:29:38 -0400 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 80B63B9 for ; Tue, 26 Jul 2022 07:29:37 -0700 (PDT) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.54]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4LsfNy3SFrz1M89q; Tue, 26 Jul 2022 22:26:42 +0800 (CST) Received: from huawei.com (10.175.124.27) by canpemm500002.china.huawei.com (7.192.104.244) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Tue, 26 Jul 2022 22:29:34 +0800 From: Miaohe Lin To: , , CC: , , Subject: [PATCH v2 5/5] hugetlbfs: fix inaccurate comment in hugetlbfs_statfs() Date: Tue, 26 Jul 2022 22:29:18 +0800 Message-ID: <20220726142918.51693-6-linmiaohe@huawei.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20220726142918.51693-1-linmiaohe@huawei.com> References: <20220726142918.51693-1-linmiaohe@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.124.27] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To canpemm500002.china.huawei.com (7.192.104.244) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In some cases, e.g. when size option is not specified, f_blocks, f_bavail and f_bfree will be set to -1 instead of 0. Likewise, when nr_inodes isn't specified, f_files and f_ffree will be set to -1 too. Update the comment to make this clear. Signed-off-by: Miaohe Lin --- fs/hugetlbfs/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c index 96c60aa3ab47..fe0e374b02a3 100644 --- a/fs/hugetlbfs/inode.c +++ b/fs/hugetlbfs/inode.c @@ -1079,7 +1079,7 @@ static int hugetlbfs_statfs(struct dentry *dentry, struct kstatfs *buf) buf->f_bsize = huge_page_size(h); if (sbinfo) { spin_lock(&sbinfo->stat_lock); - /* If no limits set, just report 0 for max/free/used + /* If no limits set, just report 0 or -1 for max/free/used * blocks, like simple_statfs() */ if (sbinfo->spool) { long free_pages; -- 2.23.0