Message ID | 20230220134652.6204-1-frank.li@vivo.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1315656wrn; Mon, 20 Feb 2023 05:48:18 -0800 (PST) X-Google-Smtp-Source: AK7set+qNk40ypAznnNYsCdgi6ZGBz+ueXjW1K0VoX+gB2RP154OIiYcf2n4KIxTMkAmKQug3W/l X-Received: by 2002:a17:907:c284:b0:8b3:1e35:8f22 with SMTP id tk4-20020a170907c28400b008b31e358f22mr11732755ejc.58.1676900898097; Mon, 20 Feb 2023 05:48:18 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1676900898; cv=pass; d=google.com; s=arc-20160816; b=nC/P7zE+sK5KbqyjdzyGt/ZazEA6s7dAdSnPZeUkpznycATqRmR9+VvtSUMLav9ghB iyclAr3p58dUOf8N8i3bnFCreg4DnThw+r6lKaGk+aMl9GhUe6ZXcc3WAMg5o+tCLGjA NLMpI/NeMAovW7g6ADwtCvyLgO7Eq1HC1qUojCdBVGb6UBB/gOaut4jyJqIXzeSbbPUj qPATLO+AxY/Dcmp8tg1JPAYotw44Io7OYu1KAj/ACcEQosJc6TiG4GI/bwCPN/HxJpuw 46SRIJjkM8LsvLp4y+5cKiW5pfDdrtGhHSJ6ymgO1MincktSXqcdjM+/ZlhSZxcOo0wX fxug== 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=xQtaz4aQV69kpUr/6zrDopdjPrmWDadZ7rpWz2CL5KI=; b=E3gCLLBrTbcKtf8i4fnFus6cKQ0ooVHCCQFJLAFvp0KT8MCX2sMeNRBA6ckK33WMfu TMUJ/lCXXvXC0QHDEL3JkLdJn8LZKScV/gQCLpU9lhr4+giJXu5tYjlGNbNhW0mchXHO RZqmp+eTAOM/r5UKCmWN682T5UikyBxCVsCfBkmhZ5yi31oxCjliO9DFhY07iFsIE4wx nMBZtHo1dxENNmDzR7eyyTRwhjwNc6PTm6T5209uuuAWtVVw0IYuNjytaTI/W0obC2tW Nx+0D1zpCVpPsKozwgLDX5iVb8udXzLUMC9lHQhBX+E1ojYqzow+qAivTfwg+UqtwxhT Boxg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=RxrumYT+; 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 25-20020a170906025900b008b17fe95459si15373566ejl.47.2023.02.20.05.47.54; Mon, 20 Feb 2023 05:48:18 -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=RxrumYT+; 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 S232250AbjBTNr3 (ORCPT <rfc822;kautuk.consul.80@gmail.com> + 99 others); Mon, 20 Feb 2023 08:47:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60210 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232291AbjBTNr1 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 20 Feb 2023 08:47:27 -0500 Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01on2101.outbound.protection.outlook.com [40.107.117.101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 70D7A1E1F2 for <linux-kernel@vger.kernel.org>; Mon, 20 Feb 2023 05:47:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LREQjqHDoWTWdQJlkxOLSNEn32g6hrX729e7xOvJlop1FRnpXo4yi7X6aakrBbTNL7GRm30byP6tlBwP978mNbYGnmmxzm2KNhVXwd8YAm6kkJSgGWC4QJOBE0jWLQBYnV26xDhUdxItVPj3x/OzZ589W70RlR1kxI9l2vtFmg3Wh2SuX/QOli7cbPonZDbuHauqPwI0m5P56snvYfYi0VCJDEZDOa4+rWjA5CdXPU0iD/WpUpG3Ejj+ojP1WcPNx3B1nWCZxY/Sii0xLpfr5ybQPHZz6+IOTinoJs27498tO2/NegkzZq8WHOvCB7b/9Gj4tUdtFsR27YG8R57MLg== 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=xQtaz4aQV69kpUr/6zrDopdjPrmWDadZ7rpWz2CL5KI=; b=iJt6NsVUcP6P7AM3Cm4zqOTPxP0JQegoSXjGwopCU6ycAK/EWKTYMD4BQc4EwsV20XQTdu2VpeLBLB8EnpUPg5SMr2yW4eSXw40ZI3FI5q/VUb8BxVbI8DWBqlmfRQZUO7SJKpQeUO2aMGWtO6rqAFDc/dsbUy8UnuJ1kPZVhq0BxShD4WQyo7QIPXZE9pUvcVG8FhNw9LzoMBG2GVbgXzA0DQXRo+8P6aKSR03ZZeTgfq5ASqokqUgtkq1CVodV1WPfOifd4HHQHo0z+2dBgRKB2HLByFw2wlnNjK2XFD9cH28K6cDSBPyFkSFk0gh760Kt67UrQXRyO/qwyUsY4g== 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=xQtaz4aQV69kpUr/6zrDopdjPrmWDadZ7rpWz2CL5KI=; b=RxrumYT+eJyLu5MjvmK9j8T2TmkKVvme6GMzMTcXZZAdRVl2X4pg59zQzxsja/MK8x9XdH9/uVIMP4BcomhkgVlq36aO3LIuGpN0T2+OALhbkT2/WAhLSCxhs+QoMMkAFnX3Nux4W1WxcvUcR2zXZ8VcOI6E3h6Sba51nklTqGtWXvt63T8N4IfhsFLiyZnpU4vkyDPqxIF9h88p195PYmTAl61NNW9QaceLSkpzmf41dGw042iu7L1pe6GalL7wOYs38sLRFQZc4U8gO+djiuOGY76d6o802NBzV3qDgLocYJo5pPXXr2fGs7no+y0OFAcRt4T9YclXawh45MCmXQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from TYZPR06MB5275.apcprd06.prod.outlook.com (2603:1096:400:1f5::6) by SI2PR06MB3993.apcprd06.prod.outlook.com (2603:1096:4:e9::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6134.15; Mon, 20 Feb 2023 13:47:01 +0000 Received: from TYZPR06MB5275.apcprd06.prod.outlook.com ([fe80::a2c6:4a08:7779:5190]) by TYZPR06MB5275.apcprd06.prod.outlook.com ([fe80::a2c6:4a08:7779:5190%3]) with mapi id 15.20.6111.009; Mon, 20 Feb 2023 13:47:01 +0000 From: Yangtao Li <frank.li@vivo.com> To: jack@suse.com Cc: linux-kernel@vger.kernel.org, Yangtao Li <frank.li@vivo.com> Subject: [PATCH] quota: make dquot_set_dqinfo return errors from ->write_info Date: Mon, 20 Feb 2023 21:46:52 +0800 Message-Id: <20230220134652.6204-1-frank.li@vivo.com> X-Mailer: git-send-email 2.35.1 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SI2PR01CA0013.apcprd01.prod.exchangelabs.com (2603:1096:4:191::9) To TYZPR06MB5275.apcprd06.prod.outlook.com (2603:1096:400:1f5::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYZPR06MB5275:EE_|SI2PR06MB3993:EE_ X-MS-Office365-Filtering-Correlation-Id: 9e1aba67-d382-44be-f932-08db1348f19b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: f+FwxknMmF4tk7oOYZdkjhu9zJvdTnA1LkpPSKrzceRCEjDyNiofAUQGSk9cYrsEZseVnvoBupa2TRZLROKih0ewHLhex5OTL65dOHeD6DpG3aPH92F4qSaGXWm3Uvs/LAOBB+sMlJbUWxM1kYnYKMAbJhfWCxDCM4MAoSfmiTr4VRuMX7MDAD+0OaShyu9RQCl3pe3HZqffrZarcnLpMZ/KpspxzKaQJGQRJx1BmCAcSz325nqlFm43fkc6B8J+Ns1u3RHjCiTlrYzDA7xcP2xnVVBRpFqkX289znh6eIlOCi7abFRpxQrb0RISU6ep26Fo0+wbrrj9AgCMFOTBIs6LZdMLISQ8OQW2NhWmp4PdovZZqpGrvdWtPMU7yxbjlyeWOM9c/T/U1fWvTukRV4z9wBBoG4LoBfySJx6ej/Tgz6ZbYSFW/wudp+QoPEVwDMkJxPEIvzREsluSoiTIp5ZKf1r7+NajmgnRD+rv+jSZXeCck1puv4sWFe9BY9xH2dMNyuM2mxja+zXbjhauLoRbF4mIk0AV5pOsyEPB04hO2OiFWztV72kWrDVG6YV/GBUOMsQ1eFGjv9u9Wf7QPPaaQ1/9bxzBySEK1YAavzYzrMLi7fvaBe+99vQuhbcI64XSsnL94OotwgtY3BRnm65U9ay1LiZxUO2YHXqwaF0Zop0DOP+RqebVjAnLiO0rXn4wPHapDE1D2kzBUMEZXw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:TYZPR06MB5275.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(4636009)(346002)(136003)(39860400002)(366004)(396003)(376002)(451199018)(6916009)(66946007)(8676002)(4326008)(41300700001)(316002)(52116002)(66556008)(6486002)(8936002)(5660300002)(86362001)(36756003)(66476007)(478600001)(6666004)(38350700002)(26005)(1076003)(6512007)(107886003)(186003)(6506007)(38100700002)(2616005)(15650500001)(4744005)(2906002)(83380400001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: PjFDYZ+fF2Gfvx41S1ddxSYzXBNKtQU2Qa06spN4hWge0WZQCVmWGj/oGaJve6KjmgXEsBo/OVQ9q2x6jXDqwX5AitE06lw48KEe0QQKG4NZCGFIC6D2L+g7viX9Sr7gRDVVFfsucBO40NNRTONPlvM43i+bAfEEWZ5x+CyYyPTspqWnGwTsuQ1jDAundl8kxAZir8a17VpFntojARVmpB/OjJ3vzUTvZ8+4qJ5ngA7L9NKoTwDw2P/4M5Zlo2rhCYkUjDBVActEik1cbOG/Y4aPUEPITYxvPidU09HiZwBy1kCxBMx/q5Gkv369Lx5zvKY7KMLiPbhkkAWk12M0doe8eNMiRZQIgcqfZK/U3wF1FjRieMHnLZ4CdZy5EgCa/JZkGbzkEjpBzB/c7kVp6aC0n/odOfwTU3IWY4qT2HokeE/AIarQ8GC0K/eOCD6DFhI6cLwyruhFkA/dqOqkBNIIxRrxdegbKFSk/UJuED2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3n5LvGLPwdvwjPo2eqU/+Em X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9e1aba67-d382-44be-f932-08db1348f19b X-MS-Exchange-CrossTenant-AuthSource: TYZPR06MB5275.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Feb 2023 13:47:01.7504 (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: b7yFX2XmEY9VqX3LB6bioWTiVENj3oBcLbQ06qq9p+/TmGsiZUdD7gVrudU6DIji6J6Pu+Yk8JERoriUtNI/YQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SI2PR06MB3993 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: <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?1758358036240922724?= X-GMAIL-MSGID: =?utf-8?q?1758358036240922724?= |
Series |
quota: make dquot_set_dqinfo return errors from ->write_info
|
|
Commit Message
李扬韬
Feb. 20, 2023, 1:46 p.m. UTC
dquot_set_dqinfo() ignores the return code from the ->write_info
call, which means that quotacalls like Q_SETINFO never see the error.
This doesn't seem right, so fix that.
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
fs/quota/dquot.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
Comments
On Mon 20-02-23 21:46:52, Yangtao Li wrote: > dquot_set_dqinfo() ignores the return code from the ->write_info > call, which means that quotacalls like Q_SETINFO never see the error. > This doesn't seem right, so fix that. > > Signed-off-by: Yangtao Li <frank.li@vivo.com> Thanks for the fix. It looks good but if you have a look into implementations you'll notice that v2_write_file_info() returns 0 or -1, not the error code. So before doing this, you also need to fixup v2_write_file_info() to return proper error code. What v1_write_file_info() does looks like a good inspiration. Honza > --- > fs/quota/dquot.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c > index f27faf5db554..be702905c74f 100644 > --- a/fs/quota/dquot.c > +++ b/fs/quota/dquot.c > @@ -2819,7 +2819,6 @@ EXPORT_SYMBOL(dquot_get_state); > int dquot_set_dqinfo(struct super_block *sb, int type, struct qc_info *ii) > { > struct mem_dqinfo *mi; > - int err = 0; > > if ((ii->i_fieldmask & QC_WARNS_MASK) || > (ii->i_fieldmask & QC_RT_SPC_TIMER)) > @@ -2846,8 +2845,7 @@ int dquot_set_dqinfo(struct super_block *sb, int type, struct qc_info *ii) > spin_unlock(&dq_data_lock); > mark_info_dirty(sb, type); > /* Force write to disk */ > - sb->dq_op->write_info(sb, type); > - return err; > + return sb->dq_op->write_info(sb, type); > } > EXPORT_SYMBOL(dquot_set_dqinfo); > > -- > 2.25.1 >
diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c index f27faf5db554..be702905c74f 100644 --- a/fs/quota/dquot.c +++ b/fs/quota/dquot.c @@ -2819,7 +2819,6 @@ EXPORT_SYMBOL(dquot_get_state); int dquot_set_dqinfo(struct super_block *sb, int type, struct qc_info *ii) { struct mem_dqinfo *mi; - int err = 0; if ((ii->i_fieldmask & QC_WARNS_MASK) || (ii->i_fieldmask & QC_RT_SPC_TIMER)) @@ -2846,8 +2845,7 @@ int dquot_set_dqinfo(struct super_block *sb, int type, struct qc_info *ii) spin_unlock(&dq_data_lock); mark_info_dirty(sb, type); /* Force write to disk */ - sb->dq_op->write_info(sb, type); - return err; + return sb->dq_op->write_info(sb, type); } EXPORT_SYMBOL(dquot_set_dqinfo);