Message ID | 20230421104943.11878-1-frank.li@vivo.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp976046vqo; Fri, 21 Apr 2023 03:57:22 -0700 (PDT) X-Google-Smtp-Source: AKy350ZZZ60AUfsq81Oi41pds5EW389FDA7EUKIEpfSS8CELJiJxjnMzJ4/QkzV3cSuxd5WNzcAJ X-Received: by 2002:a05:6a20:748f:b0:d9:27f7:8c4a with SMTP id p15-20020a056a20748f00b000d927f78c4amr6024899pzd.0.1682074642074; Fri, 21 Apr 2023 03:57:22 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1682074642; cv=pass; d=google.com; s=arc-20160816; b=RUQgEtyMBC0ihUvl9H/PlwpCperXNxBZjtT0mOsu0pOIHpEKX47I2Tu3ciG1+y4jfD MirbYVjjxQVGW5Dp1fo92N5rKGVw+c1IdpYtwcJScnjOYiuBxVbm/UIfy1opi2DAWALy to9fxX1OF8I5lVKS/MP8s54jBftZH7xEmd+JXZw5eItypjhxekNvFZ3dGhPKGJiA066I CTuO82MgjvsZPOVuAtV70vsyAk0eTirf70QNq5qzDL5J9Y69zZznVQVel0K4GbmF6PHM i+UQ59RPLmD+YjdjUXK+bTa9uHJ/jNdkam1Gl9HlLbs7+J732fyURn/Jp50DnxvcATBL 6FUg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :message-id:date:subject:cc:to:from:dkim-signature; bh=eLlXcvR2SbAtB3WMLuhyZt6HKuwEbd9pl0xYHE9dkZc=; b=sazjGapFM0cdPppKXMJcFAyClq2Rcjbhjq5roBF4MjY4fc/RBlJfYhL/nZ8SnS6iBm 2SSFB2jyqz3iTRWLRfvzwvPCqox6chh3cALT8ZC/+Hr30neKYJ6suQk7LhwWlTfiBbc3 EAzYkwd9FDWyHIqOeTzWkfrEizDkcxzfP+H3fmnlkxVIiDkP3h33VFBeCzN+ndRbbC3m P5iRvUTWPXh4NpvJ3YMUa6vc6sYuu55H1vW0+Yj9AfsEdM2FFykud/WnK+mfNZX6Fpjn q9uoraiax7evD3dlrJ+JzE8rsAFeowojV+qZ/hlilXiSxseBGrT+OojgNoJj6idkERHe u07w== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=k05CwEQD; arc=pass (i=1 spf=pass spfdomain=vivo.com dkim=pass dkdomain=vivo.com dmarc=pass fromdomain=vivo.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=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vivo.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c1-20020a656181000000b0050fb1a00d3dsi3919979pgv.46.2023.04.21.03.57.09; Fri, 21 Apr 2023 03:57:22 -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; dkim=pass header.i=@vivo.com header.s=selector2 header.b=k05CwEQD; arc=pass (i=1 spf=pass spfdomain=vivo.com dkim=pass dkdomain=vivo.com dmarc=pass fromdomain=vivo.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=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vivo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231429AbjDUKuO (ORCPT <rfc822;cjcooper78@gmail.com> + 99 others); Fri, 21 Apr 2023 06:50:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40276 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231598AbjDUKuK (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 21 Apr 2023 06:50:10 -0400 Received: from APC01-PSA-obe.outbound.protection.outlook.com (mail-psaapc01on2119.outbound.protection.outlook.com [40.107.255.119]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5B88B93CF for <linux-kernel@vger.kernel.org>; Fri, 21 Apr 2023 03:50:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=U/yJupf6bubNrtqj5usiXLZRp8WPM47E942NEHrpCQ7GiGJGC85FelUDUl5CkyrwakKOe3mrZf4QRp4PTrVUnMzmG03ktK5xPa6MlLiHzVO7iTW/2AGJhrsDWKZM+RLg0kfj62Np630WkOPLrRk/wEY3n0AaQ8LG2ffBSZHM3DsVhWAttKzA8AdeYXwnOtLLwDPZPZMkQua8TUUA8cPcc1rWgJZ+nMzsI0UYr+Poy17bzEehJhgLLDh8NYpr22iRScVQPz4wUTPYe+TOXGoclIvlJ2TLnscbo9atvtUkeRf0bXUafWfO7KwV/W8nq3uIFkPBjfDdFLbH1dabmRMMbg== 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=eLlXcvR2SbAtB3WMLuhyZt6HKuwEbd9pl0xYHE9dkZc=; b=MbmAYmBk8REuhmftHn4yb0BZtgkwdueZkjyNtR9ws2BHCHvWImSAh2fYlwpOhwgY3rLqkmSezh1UfvUGG8eofAbm2WoO1hd2/nJmL4P6lOrS3Z+ooUHIXlp42lu8Vd73Rd4kHdwK3z/0hXXdVUknAjcX+fF6r1EtwKjbEZY/6ruKYRACbDripbr7N241okE6j3UaKdtZ1EFmW3VTFAwFr5yqa8hbj9F/vK1uTjPVZ0oSSESQHpGoxtRY9IzEwes4yD7YAnyEzRLLt0ltuJa/PMn6bTtTpuV5zFp8vDOwwsIOcdeL+kouHXeIencFMUnmld+jlOZb4nzA3wT979/n2Q== 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=eLlXcvR2SbAtB3WMLuhyZt6HKuwEbd9pl0xYHE9dkZc=; b=k05CwEQDrQY+TFa8RrrZwan6mKkjcZPGgW7IeWRiyMB2GQUiKLWx2pk0xDcBUg55oi7NcK82+GsMEDSH1wtdExGauUzMr50kSAuwl4Onf0kw7BeFFhLbGX7sjVMiNPD1kAM8n1Qvn1WWCbKeMcssvP+yrBuoXJrXOOlvhl+7kHKpp8nfL97j6pU0lElOBiCy0KB+NJYorhP5uBRxso/0WMOj24skac9gBTw95wQRDRyDgutK0sJJBBFsuagpf+BptTHk/U99EzAxDMgSWxT/+escYXV+a57ACB+F47oYou7OlBxAlZx1oiiGORwdBoJV+jD0/VUIM0Ju8XFnZRSP3g== 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 TYZPR06MB4634.apcprd06.prod.outlook.com (2603:1096:400:125::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.22; Fri, 21 Apr 2023 10:49:56 +0000 Received: from SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::76d6:4828:7e80:2965]) by SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::76d6:4828:7e80:2965%7]) with mapi id 15.20.6319.022; Fri, 21 Apr 2023 10:49:56 +0000 From: Yangtao Li <frank.li@vivo.com> To: Jaegeuk Kim <jaegeuk@kernel.org>, Chao Yu <chao@kernel.org> Cc: Yangtao Li <frank.li@vivo.com>, linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: [PATCH] f2fs: make __issue_discard_cmd() return more appropriate error code Date: Fri, 21 Apr 2023 18:49:43 +0800 Message-Id: <20230421104943.11878-1-frank.li@vivo.com> X-Mailer: git-send-email 2.39.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SG3P274CA0008.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:be::20) To SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5269:EE_|TYZPR06MB4634:EE_ X-MS-Office365-Filtering-Correlation-Id: 8428019d-2476-4a85-2703-08db425624ca X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: w1rs6koQEk1+ow2Iqs4NXfZi7iKjPkTwIZoSPHHToYVXJOmg2V7BBtpvSAG+Su4hGMzLSj0q79pM312sc1RVUiWI0+RTibz4+6UFMX81VDx/p997cLJl+OINE8I1Ds9tzN5qJHGzobPHSuqXTrTlDosHFL3Bu2HLhO0sdP4kQ4xFcqR4CvP8TcOY6wJKb8iZ3e+jaWq9i2qx61r/9RaXlsCeKOpz7pnrUxW/aRZgfQouibJoRkEA0g7bZcDfUCZ7qhOqhzb4dkX9qakZOsBvZI1mawhnJQgBwDV51ZXdwLhePtQqNrZH93JbBEDuSFbCd6sgQzYKBr7/QpRvzEq1i2OEjs7xdA+nqYp7Tz0bjR1E5NSUIYRp21tdltYwFt2E6+pDDsJxqm/LwzlQcOH83gB5wui/wCDYsKQcmX7bmrodJzFWBOPc6St8mJYP2TnU3WnGGorL/g7ycaaScVnJkhAbDIhhlWJZh9k5w23aKt3+i4VLaLn/3OrxypbH3Hnh50EsjZVAC+HZiZj41q84CzujhvcdhQH7QI7WNH+BvEAx5oSKrJkLJJp1GZD9tptWxfsCoXSiG3xr/Szwszy0eOqAHqGepCQUfxQL9rwe62ZSAsgreZAtRyBCEQERYXDr 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:(13230028)(4636009)(396003)(366004)(39850400004)(376002)(346002)(136003)(451199021)(316002)(6506007)(26005)(1076003)(186003)(6512007)(41300700001)(83380400001)(2616005)(110136005)(66946007)(66556008)(4744005)(4326008)(52116002)(6486002)(38350700002)(6666004)(66476007)(2906002)(478600001)(36756003)(5660300002)(86362001)(8936002)(8676002)(38100700002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 3QUVvG0wOnP0JgZFqRADsDk4CbUncw9XtlqzDc8OvK0zpD4WbI2ag7rjhaD9izwlcODnXPq39/eq4lWmCDux/QZLCzPxL3NxTUVbsrKMQOj+SxWtX7edoT/k8EaeiRcTqb5om/ZCMgB0p04+F2X4Ucf/DcOHYn1XJvhAyALH35blMKSYmWaLD7XduV9lOR4BfTEr7XmZcPL17E06Q5YPaYkou6MSH+FIYj89iqWq85H3nyDhraIEkhn+P7ZxKvbRWgwVyuIIQ03CdZpVcU91NDhtduXjat9zIR98z97prPAHd0IvCV0JWpcpWxyvbSvjRvHdPplH0hypehOsSmMSN7A1NSwxaBjpLyIhM7Ivb+bBhmrdPZg/eTdov2Dl0IMO/qDD2lhBur8mJTw0z3fDJ2wynJmvg/XiD+edXzY7/13dZlPXrhCMz64i3CnRab1I1QeXsWoM+T42i682X4YsasHULz7KyJioJgmKBtq86dD5bNyalC0GPtYVYgnsj/wnXg4s7Wqu78+CsQzbFxwjsdUA6o+XEV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S-Exchange-CrossTenant-Network-Message-Id: 8428019d-2476-4a85-2703-08db425624ca X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Apr 2023 10:49:55.7650 (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: mnmy9S8Opb7hccq1robMzj/kEAysDkII6InqcEgSyG7k2QLZrcF/Q/rdZ0JRFkXtrVL8zIsj55TBRYrPZvgwpw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYZPR06MB4634 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1763783099869584866?= X-GMAIL-MSGID: =?utf-8?q?1763783099869584866?= |
Series |
f2fs: make __issue_discard_cmd() return more appropriate error code
|
|
Commit Message
李扬韬
April 21, 2023, 10:49 a.m. UTC
Returns -EBUSY when __issue_discard() is interrupted by io,
instead of returning -1.
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
fs/f2fs/segment.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index 6db410f1bb8c..a005948dca93 100644 --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c @@ -1604,7 +1604,7 @@ static int __issue_discard_cmd(struct f2fs_sb_info *sbi, } if (!issued && io_interrupted) - issued = -1; + issued = -EBUSY; return issued; } @@ -1829,7 +1829,7 @@ static int issue_discard_thread(void *data) if (issued > 0) { __wait_all_discard_cmd(sbi, &dpolicy); wait_ms = dpolicy.min_interval; - } else if (issued == -1) { + } else if (issued == -EBUSY) { wait_ms = f2fs_time_to_wait(sbi, DISCARD_TIME); if (!wait_ms) wait_ms = dpolicy.mid_interval;