From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 86783C00144 for ; Tue, 26 Jul 2022 14:29:49 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id F1BC3940008; Tue, 26 Jul 2022 10:29:42 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id EA34C940007; Tue, 26 Jul 2022 10:29:42 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C101B940009; Tue, 26 Jul 2022 10:29:42 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id ACF3E940008 for ; Tue, 26 Jul 2022 10:29:42 -0400 (EDT) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 8604EA05EA for ; Tue, 26 Jul 2022 14:29:42 +0000 (UTC) X-FDA: 79729484604.16.E9F2592 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by imf28.hostedemail.com (Postfix) with ESMTP id 7FF0EC00AD for ; Tue, 26 Jul 2022 14:29:40 +0000 (UTC) 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: 8bit Content-Type: text/plain 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 ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1658845781; a=rsa-sha256; cv=none; b=tJKo8cjXb6R4ttqJ/vxhREfTubQOwF+W7P9VVL/hPX+UZMh0jv76VHpHpMkN2iooken/Iz aRULq2HX+BbYw0VJiJ662ap4kuMDs6TZTb/q++sqDS3w67HIfE2RHdi5h9+RKy5WuwOPV+ 8UZNIpIz6di7NNOUcXgJWY3YjFi/Xzs= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf28.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.255 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1658845781; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=m6KdYVFGUbU6VdoR9jLjv+Ul8sm1sD6C1+E8PC41iJU=; b=yfYAqzWtaQKt+aOPPg/q+xqeOwhwZRZ7mGhwOUDy/3aKl+7lrNGS9yDpRQV6ZVCwZMgCbO EI+z0s7hE/BUwRIvCBwxsfWHx9efY3zgvfbXwbhjXOs8tKFKkEOuNzTW79kaOYpYHQF9yj 6kCsJ8PXaAm1A2GYlGq1d9du7xZkoOo= Authentication-Results: imf28.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf28.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.255 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com X-Stat-Signature: nhjynrsfgynob1zz1gjfooha3dzy3fds X-Rspamd-Queue-Id: 7FF0EC00AD X-Rspam-User: X-Rspamd-Server: rspam11 X-HE-Tag: 1658845780-24413 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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