From patchwork Tue Feb 21 14:45:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?5p2O5oms6Z+s?= X-Patchwork-Id: 60123 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp51532wrd; Tue, 21 Feb 2023 06:55:05 -0800 (PST) X-Google-Smtp-Source: AK7set+FKchz/Y3Iw/BwRgVVVFXm3rZgttyi0+yDQa5P35rvW0uopNWZeKltKPihGRogiVQoJIuR X-Received: by 2002:a05:6402:1356:b0:4ac:746e:2edf with SMTP id y22-20020a056402135600b004ac746e2edfmr6084078edw.9.1676991305414; Tue, 21 Feb 2023 06:55:05 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1676991305; cv=pass; d=google.com; s=arc-20160816; b=A8X6drJvnZDkxzHaMtBIsX8A9VBKzhPufoJ5Qb95bq9bffNuRvm9+i64M+kGaYvrm1 lHOhzy/pLjURAr3O93mIM7o39KhtqYcKcGnn48SxDu4frsLailneDT8lNFVEk1rFxhE0 xkO8XOPeDsCNWlb74eFzUzcjukHcOd1rOEpKb0oPF/ZVUZV6YkT/bP55jfWbb/kQiGrE Z36reVexJDm2WGtfercl/z1G4nmsBqkWuIX9t6kthvmNxVw84t+xPjdEfKOPxfjUtuyg N6hFwmJIDikHeqeJ9zuLLL+qPR/M/Bh9ZR9HKB/UmXLDo56opRVsrlll+C9xYryx05dS bOGw== 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=6CAgJ0RCr7zliEbWYAvawyfjQijB5EsAOpDsyPVGK80=; b=coAEja5XyVaxJ9ZDtsao9SiDkecnueB/8VGKj4oz4fo6P4cpIzHAlUAs3ZBlqkW9oo Fukoenhr0c0L0QKygQkxERYUP3LRb5ivHFReYaFZeh3fh19zeZMwbd/uP40VxM2NKxKT Om9gsOTpEMROMumnyiWROKpcVgK+KphNgagmaOrz/5t8o9UqDDyquRgo9IF0rBQNL7zZ P6KsCua98HDCxUuCE5KQMpxKLIuFogSQMjkFKxoGRr30oP0m4S402GZ5KfFIfxQsu59r 8045KiMcm9dFeZHKMql1lQHXLk0fUfKp+RGwICqkSeczxIceMZPnHuRa81NJm8FwilaT NmZw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=nlj61ufm; 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 y12-20020a170906518c00b008ceead154e9si10529820ejk.942.2023.02.21.06.54.42; Tue, 21 Feb 2023 06:55:05 -0800 (PST) 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=nlj61ufm; 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 S234090AbjBUOqM (ORCPT + 99 others); Tue, 21 Feb 2023 09:46:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37504 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232049AbjBUOqK (ORCPT ); Tue, 21 Feb 2023 09:46:10 -0500 Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01on2103.outbound.protection.outlook.com [40.107.117.103]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C7B0826CD1 for ; Tue, 21 Feb 2023 06:46:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hbkfXl917kkeGCgqfXguj3tsXPZfz9YyWnYpHKz3Y8IFAfBec4CSg2+uWJb4Xru1xuVTPqU5owpMJ2mSOjAcVz8xp1ulnlpKIFxO7aLHpDvjJ+f7tqqnRp5K5vuPtOuvl6iXbxLQkA+Sr4Tpz6CFmPMbFF7Du07iVdLpCrssQLt4xTnDqdVnGv4XUo4AiSaMgg+6AlJLXLAqFJKtErTRs7Cx5zXO9wSvac04SsJgAbTNQwDjf9xc9vPviEuQEU9jxUQ+4w4BY9CJ96/iFPHT5Cdicx14g2iTU5FXDt4183owVCh68YhtAFA1AmuwDhd3wE0UWIxC/nGU7HId6YFZRQ== 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=6CAgJ0RCr7zliEbWYAvawyfjQijB5EsAOpDsyPVGK80=; b=gH57L/b8rFOj3rutlxOjBI1/uZyIKkVxBe/xXN8Vf941ihHH4dnekkEVXxs2ENBbmCPbIebTU4ZBhI49JNFaLA3fE88VaEsfGr8ItaaEw4+IRMYjyRCASI5pbUtK4YuSnwOkGhN/lLVTiNhNrlhm8huJdBUXi/oBGcNB7DwdMNqjWTe2Do0gRdhiX0w5TJehNIVtOhL2am7IUTdQbk9Hb4CCWpDk6e896caFi4JQllMGDqj8WQ2I5OB5Sl5VA7jhfFJ0QekHN/V4IvVePXAQBV2nTwgIlO8ocWZ9SYjUVZ1X5XGSLthn4GAeQESFCkW0buIPxe0q/n3VxD/c9jyJOQ== 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=6CAgJ0RCr7zliEbWYAvawyfjQijB5EsAOpDsyPVGK80=; b=nlj61ufm0QFSRaj17FiTR8SpnVUKTktLZFoBcAH+YxcenE+d/df68sQS0Y9V+bcCMpOxAt5NxYy5YhlylKqVRCANfxBucpD6anUD8wvGVnoS18GfwGMhF08Dv/AB+YvAma3ShCOK947NmhhzDMbu6K7woXpfDE8/c9TAWtXaaQFaHG102bJcPeuLY7+m3CqFqsasHCN75NU9a5MnQdKKE93lewR2du0UkQ6+EGjjmzWp1yWYTGwBcEH90Wjm6jZljbZVxHZTB/rrGSDNtyVtiobVaiye6OLyeO19Z0J+Dt0ejCGpkvtj3nwxaQkt2fItAcj0n3I0MsKeuVAGl1p6ZQ== 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 TY0PR06MB5848.apcprd06.prod.outlook.com (2603:1096:400:275::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6134.15; Tue, 21 Feb 2023 14:46:01 +0000 Received: from SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::daf6:5ebb:a93f:1869]) by SEZPR06MB5269.apcprd06.prod.outlook.com ([fe80::daf6:5ebb:a93f:1869%9]) with mapi id 15.20.6111.010; Tue, 21 Feb 2023 14:46:01 +0000 From: Yangtao Li To: jaegeuk@kernel.org, chao@kernel.org Cc: linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org, Yangtao Li Subject: [PATCH] f2fs: handle dqget error in f2fs_transfer_project_quota() Date: Tue, 21 Feb 2023 22:45:50 +0800 Message-Id: <20230221144550.46557-1-frank.li@vivo.com> X-Mailer: git-send-email 2.35.1 X-ClientProxiedBy: SI2PR04CA0001.apcprd04.prod.outlook.com (2603:1096:4:197::12) To SEZPR06MB5269.apcprd06.prod.outlook.com (2603:1096:101:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5269:EE_|TY0PR06MB5848:EE_ X-MS-Office365-Filtering-Correlation-Id: c8e9ae1a-a28f-4710-eddc-08db141a5996 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: qQnvZhhwEcgdHMpHd8A6IafIGSltIqmdiRVCmUEMPSV6BOIj/XYOOoMjK5P7cWBlcm4Wiy1N31wLdVe8PWn+UausNY0ghH926uyJrRdzErFR6ZQBWZt7Mdae9Fo7uHFCEcO6yrEY8qSA1kfqizkaTtdgMvbj/Vqh7ghpkfvydnrgwRpD9Empu5flbZ1EikmEWgqrkou6YrxjcdFVv6q+AqNcXBO6iQPSbtuGz+B1Yvm5hFfQ4LskVufJVc6abQrnHNKRME8OgUno46F2ukQ6Eo+4SNTeII6qPOHaNBXRo9IaAWWMwHFKt03sfLJhEjpaLW2+r+q45OEpO7D62TKldFXoaZPG/KYtwb3f5b5CvdDegfRAkpkGa34BMuf9on2QCzRDayDtS8qpkhweKNN4RUZFgpHNFchz6+npP1DsGqfnhRPAovujDJ0pv3uonkh4yA9eWzLIwSutxLLzfuDCpIYso0dhla8TkR9XcReNgUYEmapGaCxoZ0WPmnNP67mHPyxxavN2QvrqIdX7gfajLRpwDbyAtkPvOzRIE8+OyoDajLGYiEtM2G0aPlE3FKDeG7vSqD4sux9uKRsHR1OTcu7ts5xelZUKQw6YmLLbCz4P2HSCq3/GA/c+pG/RIvuha+o/5C/STlgcfDGQPpDsdAQih8T6XU+oJiwDleUo0dbQ/sUNjrCjK8R1pD4zmoh0APg/+2+ohfwilHCzGpKhfA== 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:(13230025)(4636009)(366004)(346002)(39860400002)(396003)(136003)(376002)(451199018)(4326008)(52116002)(66556008)(66476007)(6486002)(316002)(41300700001)(66946007)(8936002)(5660300002)(36756003)(86362001)(478600001)(186003)(26005)(6666004)(38100700002)(107886003)(1076003)(6512007)(6506007)(38350700002)(8676002)(2616005)(2906002)(83380400001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Q1N1oF2CtSd8oWurM/VVV/ojPVdtEbqmIW3pJ2j8y/kF5TsoqaMARImMDF0RHLiVJB2J+ZaNN2FJORI7AnTP0lc5O8fZuE03UMKh5HifynAeZgl9vvDghGiikXD/cFZJUbP8rz06+ybpwRtZRj9rKMYmwcXkgf0cHE/l5VWlt5+QXII8ComqYC9wKbhr3hbXh8FpiniZ4dkDLMVtTnPE55KeQl/92E8D+6bQ/GESE+ceR1DFl4hGofxBGMObEMlriQgNhWxvaSe+MOhGAWpfmcsGAOh/+Ku1eQ5p1ayiFlBIPcUek5HAANm0DJKg9fwj+pDXx0ZI9l2+eGVCOAtkc/CFGPGHijC15+G3MGRFsRaE5dnAXnlracMMAvFcKP2R8/Fh98Lj3L1KIQhBa5G+gwt7qK7kxKDoDWLlb0JmGE4UbdcgOQnZsbveP7qXKItkH1cIOGYpoVT2RCIZykzMwMnsva+JE/J9r126UlratG3g9WuVp2RbF9J/neajPqVMI8vD65eJVAf8eB2b7Nqbj/w1PLzZ+4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-CrossTenant-Network-Message-Id: c8e9ae1a-a28f-4710-eddc-08db141a5996 X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5269.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Feb 2023 14:46:01.0481 (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: 1+aFgqDrvDxBP8xCs3O98HmTz4CkeOppQ2yvNaaPub+Mrbxkl6z0aQ0Yve28+pg6fyoVydbpL+rqeEiHdRoQbg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TY0PR06MB5848 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 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1758452835267282421?= X-GMAIL-MSGID: =?utf-8?q?1758452835267282421?= We should set the error code when dqget() failed. Fixes: 2c1d03056991 ("f2fs: support F2FS_IOC_FS{GET,SET}XATTR") Signed-off-by: Yangtao Li --- fs/f2fs/file.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index ca1720fc1187..f25e58680984 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -3009,15 +3009,16 @@ int f2fs_transfer_project_quota(struct inode *inode, kprojid_t kprojid) struct dquot *transfer_to[MAXQUOTAS] = {}; struct f2fs_sb_info *sbi = F2FS_I_SB(inode); struct super_block *sb = sbi->sb; - int err = 0; + int err; transfer_to[PRJQUOTA] = dqget(sb, make_kqid_projid(kprojid)); - if (!IS_ERR(transfer_to[PRJQUOTA])) { - err = __dquot_transfer(inode, transfer_to); - if (err) - set_sbi_flag(sbi, SBI_QUOTA_NEED_REPAIR); - dqput(transfer_to[PRJQUOTA]); - } + if (IS_ERR(transfer_to[PRJQUOTA])) + return PTR_ERR(transfer_to[PRJQUOTA]); + + err = __dquot_transfer(inode, transfer_to); + if (err) + set_sbi_flag(sbi, SBI_QUOTA_NEED_REPAIR); + dqput(transfer_to[PRJQUOTA]); return err; }