Message ID | 20230117095407.37398-1-frank.li@vivo.com (mailing list archive) |
---|---|
State | Superseded |
Headers | show
Return-Path: <linux-f2fs-devel-bounces@lists.sourceforge.net> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1445DC3DA78 for <linux-f2fs-devel@archiver.kernel.org>; Tue, 17 Jan 2023 09:54:53 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from <linux-f2fs-devel-bounces@lists.sourceforge.net>) id 1pHig7-0005NY-QZ; Tue, 17 Jan 2023 09:54:51 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from <frank.li@vivo.com>) id 1pHifo-0005NI-H5 for linux-f2fs-devel@lists.sourceforge.net; Tue, 17 Jan 2023 09:54:32 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=MIME-Version:Content-Type:Content-Transfer-Encoding :Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=uTrEb2Cwr9F7vWkD0UMRfe1+egrfVdeiqDQjljagu4g=; b=lhxt7Y1r0pSbItAAOkz3gpBNb4 3bgJbe/5nPGB9ZCF/s7PmmzJ4//Kkn7MEsaAuSOreXHPeqYIpXjqDXYVACdQgN31lH/8tdLJYhx0B wWlaz/jQr6lNG2iHEjcmw4QeNJF+GaHaCmsjPEgFuiB+gjkCT4ecp2L6HxP4BMNh7OdQ=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=MIME-Version:Content-Type:Content-Transfer-Encoding:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:Content-ID:Content-Description:Resent-Date :Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post: List-Owner:List-Archive; bh=uTrEb2Cwr9F7vWkD0UMRfe1+egrfVdeiqDQjljagu4g=; b=b k83lYNyJbbmB/R4IR9thUJzaqafxWibCSK5CwbrtAcaEyUCgJHlit0gnpPWaEgiSKDBnuwL/V9hbx ErROpj09qAjfG5nWbYYiigEo+LlQJz49Xqf2uW2Yg+oZGoCz22TFfKZ2uwbrVRHTDtVTp68bPVdjU KD/zn1a5POe4Cb5s=; Received: from mail-psaapc01on2138.outbound.protection.outlook.com ([40.107.255.138] helo=APC01-PSA-obe.outbound.protection.outlook.com) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1pHifk-0005kQ-1w for linux-f2fs-devel@lists.sourceforge.net; Tue, 17 Jan 2023 09:54:31 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NSDO3woNzIc4ONXQrmHiqGB8Ll8z/Q+d7SMXmK6VCNb569Zy4qA9j2e4gih7nET3xqvOagUfPcGSzFVMFO+7vTqd0RfS3zfISKv+rEP17HORGvmsVuFOjiGBdDid41xe7waowx+lq4iC4kTqHgEA/Xg6pE4QJo1yGbuOpfLrIier7rFQeE+eqzTMluefL1Zufn0gJ25FR4lIlKP+2Ne0/yuOBgKUpdOmUZQQrMMPUAKd7oIMQOmLNheZGnlZRaqi1h0hJeJym0Gu7+C2+Q4oJ2xkDe/TcvRgOI0UFZvywCaSqt6xJr1UPVujtHip6Y4fjUvQWwgvC2uWj22ZqvsLJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=uTrEb2Cwr9F7vWkD0UMRfe1+egrfVdeiqDQjljagu4g=; b=D+jt3oZjG4zBnM4pN3tVBcOePpYDjjieKCys40OWPfUO2KnYW2A1igCAlBdgsb/32eMWoSHhrW/ocqBrFFxA7LtzepoBdpSLRGSlmqBJ/zHyy5B9Xauwli1AjdpijD6M3PrIkJvyvBIV+VtUBRA7DMSwgl8kT58MEY+5ADqznv0UMkc7CCJZa0nz5V5e3+ca8ONiTX3jtedOsSJOFqJwE3drUEw3tV8ShJlu7f0WwdbglcZeJ+P5hK45jGjtp+qATS+6XHC9RS+Qsjj0UOTNHdERrQmo/XaexyYCnbhyV9bQOpoCDgtxBd/rHhKbuNWeyKBuM5NXJ9lO2zP/9jcL3Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vivo.com; dmarc=pass action=none header.from=vivo.com; dkim=pass header.d=vivo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vivo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=uTrEb2Cwr9F7vWkD0UMRfe1+egrfVdeiqDQjljagu4g=; b=m2kdxy41oHRWZbJlIC+vdGKZU5Urmx2KcAqW9/tznPsZO1BWDBS9xGLtV/MSTIu9A+qwPMgu9x50wxf8SR9xWTB8sLsGIBpic/L1aW984NdropJpHmPx2pVAlCoFLiwvT47cf54aCo+LMyJS2nXaDwgZXKE8ieqKbVVeyi84faQWaGCD5vDdAVlqh5Bi7+hor6+H+ti5Jlw88NoCKta4AbM/a6hCemQCwcmavlb1lPUKXGr5UhmC6h5OpFy7GnheWHbVN/kDsE+2tnZ1tU7ruXK+2odUCSakRaBay7LK72cqseZ5lEteOl0RdQl0yvZuiKKfzDKUw8zqB4yKFTA10A== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) by SG2PR06MB5287.apcprd06.prod.outlook.com (2603:1096:4:1df::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.13; Tue, 17 Jan 2023 09:54:16 +0000 Received: from SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::3e52:d08c:ecf4:d572]) by SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::3e52:d08c:ecf4:d572%5]) with mapi id 15.20.6002.012; Tue, 17 Jan 2023 09:54:16 +0000 To: jaegeuk@kernel.org, chao@kernel.org Date: Tue, 17 Jan 2023 17:54:07 +0800 Message-Id: <20230117095407.37398-1-frank.li@vivo.com> X-Mailer: git-send-email 2.35.1 X-ClientProxiedBy: SG2P153CA0048.APCP153.PROD.OUTLOOK.COM (2603:1096:4:c6::17) To SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5269:EE_|SG2PR06MB5287:EE_ X-MS-Office365-Filtering-Correlation-Id: 2074cf09-3ebe-4aa0-220a-08daf870cb8b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: AUR77EBxYT7lAQEock5u7mXhtV5HU40MwQ4BMJtPB605A/crbLDGV990GdbFhr5eadUpCckOLbCyhzyESGBapPuwewiILOqFNSAANtguX7telX/sfSYlwV5JxlWq5q8pIwNVXiblqEA3PyGBFa4Mw/tJQttBcH2XdV3/3qREHFwgEEaiaegnJutbQRwo1j+qnKkq8/2ltD55cAelyqV3IoTE9ceWexZsPJckDSpbEUUBBX+kZJ/0fAKVjXZ4yLZZG8WhEKiZ78ZV/v+8a4KCf/WxsIh8TB4xaJeXt92/o6PSj4/J4xlNn0LJxmt82291QiBY/UkF27cclnVPB9IfFeXxlGBCDyrl0Mgjg4ll0Y96Ajg+jfr4FHt/150OoTsWxgjZTImT0Ta6gJZnGmsGhKQZ/BeMYvOqEH7ffTIO3SOefDgsKe4iYQkSR18FNYWb/AfTb6ODO8Afphx4hrLOSle9qp4ed0d/S8XEfjJGdk0pXYHtRLvEOqEyWPtSLBZILc9dMUcyjxeJQOWZu814cH+nFPkW17efUr7zeu0cWvSdSfRGLmRqO/QnPtfv+fgVNUGK1wb0AiDXzOmL+lgW/3i5YDp3ldg70+GOEbnuoCGUMMNomUlq/Ky4sBdBjyTfHlWOPUk7DuiqRAq/lCYz4GwjsVPoGsMeaXVf8wvAON4OofLQolJVrGDdEQktQhM8 X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SEZPR06MB5269.apcprd06.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(4636009)(366004)(39860400002)(396003)(376002)(136003)(346002)(451199015)(6486002)(4744005)(8936002)(478600001)(5660300002)(4326008)(41300700001)(26005)(66476007)(66556008)(8676002)(66946007)(36756003)(2906002)(186003)(316002)(86362001)(52116002)(38100700002)(38350700002)(6506007)(6666004)(107886003)(1076003)(6512007)(2616005)(83380400001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: G9ENNNWLYhn7G4VT9/y1VAfi53ijOLblbs335QSelqPIC1o2JGR3/GO5W69CGtxMgdlsaRqpXGBtY42rK76dyqH/RsRG8868tJfbLkGzOOyIPn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E9AWQ4muwnVVtXBKGYOv7MO7GZUmZblTK0jAyCBUYxcAbGflKQLFBAc4QW8OaFgk7MYzOe+hU5PdoSzxN3u+2P+5sALrlSdFWhHDxy74cE6OKF5C8C/9VP8I5RleBy32w3CjOkYlPC/fi9+GzfqRvowZBnkZ425eIV9mKHDr2x5FTLZHABMqwlAiQa7v3nH/f19IQxHNDgm35MAO67PrScasWTN5VLzK/JYt+qGHO4EG5GlNKbU0L8sCitkzcYHjE/r/8MByFCQOu1bGtuRg7n+u75ubFbXTSLtYxHfMbN/Td5EdKJYkwfI1RstquBOtkiwgnnNvOWceuKiiLuFh3BJ4LImvyWjVuoDNKc5RTifFluZb+0tDUtWQgffVEMZ053y3 X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2074cf09-3ebe-4aa0-220a-08daf870cb8b X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jan 2023 09:54:16.3921 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 923e42dc-48d5-4cbe-b582-1a797a6412ed X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: u0CH34Tp0rqvv8FSkTz5OIO6fC1nBTO0SvZAvUsAvuhgL7xdhP4j75IIFk6N+wbpqOnXAXRFgzJ6G+5R+5pgCA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SG2PR06MB5287 X-Headers-End: 1pHifk-0005kQ-1w Subject: [f2fs-dev] [PATCH] f2fs: fix to check warm_data_age_threshold X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: <linux-f2fs-devel.lists.sourceforge.net> List-Unsubscribe: <https://lists.sourceforge.net/lists/options/linux-f2fs-devel>, <mailto:linux-f2fs-devel-request@lists.sourceforge.net?subject=unsubscribe> List-Archive: <http://sourceforge.net/mailarchive/forum.php?forum_name=linux-f2fs-devel> List-Post: <mailto:linux-f2fs-devel@lists.sourceforge.net> List-Help: <mailto:linux-f2fs-devel-request@lists.sourceforge.net?subject=help> List-Subscribe: <https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel>, <mailto:linux-f2fs-devel-request@lists.sourceforge.net?subject=subscribe> From: Yangtao Li via Linux-f2fs-devel <linux-f2fs-devel@lists.sourceforge.net> Reply-To: Yangtao Li <frank.li@vivo.com> Cc: Yangtao Li <frank.li@vivo.com>, linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net |
Series |
[f2fs-dev] f2fs: fix to check warm_data_age_threshold
|
expand
|
diff --git a/fs/f2fs/sysfs.c b/fs/f2fs/sysfs.c index e396851a6dd1..b59595daf3ef 100644 --- a/fs/f2fs/sysfs.c +++ b/fs/f2fs/sysfs.c @@ -689,7 +689,10 @@ static ssize_t __sbi_store(struct f2fs_attr *a, } if (!strcmp(a->attr.name, "warm_data_age_threshold")) { - if (t == 0 || t <= sbi->hot_data_age_threshold) + block_t avail_user_block_count; + + avail_user_block_count = sbi->user_block_count - sbi->current_reserved_blocks; + if (t <= sbi->hot_data_age_threshold || t >= avail_user_block_count) return -EINVAL; if (t == *ui) return count;
hot_data_age_threshold is a non-zero positive number, and condition 2 includes condition 1, so there is no need to additionally judge whether t is 0. And we need to judge whether hot_data_age_threshold exceeds the number of available blocks. Fixes: 71644dff4811 ("f2fs: add block_age-based extent cache") Signed-off-by: Yangtao Li <frank.li@vivo.com> --- fs/f2fs/sysfs.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)