From patchwork Tue Dec 24 11:46:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: zangyangyang1 X-Patchwork-Id: 13919944 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 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 87B7DE77188 for ; Tue, 24 Dec 2024 11:46:57 +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 ) id 1tQ3NH-0002YJ-Ul; Tue, 24 Dec 2024 11:46:55 +0000 Received: from [172.30.29.66] (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 ) id 1tQ3NC-0002Y9-Ck for linux-f2fs-devel@lists.sourceforge.net; Tue, 24 Dec 2024 11:46:50 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Type:Content-Transfer-Encoding:MIME-Version :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=HxADCgy7af/zo4TiXSQqx6HCMZiUTkLMLlW1sthiMkY=; b=Y5LGEY9GOYg8C+7yTf/yzKlz5l nf/q6rawywb/MIZvokHWM67BT2wwctsdGl0seiLqxtXYPDEg4CsdBHA90ActkxF9gv8r6IBdQWYqR cv4yWQ57Vm22J0/+vJJjbcgnoMZn5MvLbHpnpd5Hop7rxCvMcV26Cz/ujNpbQ7h0EBpo=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Type:Content-Transfer-Encoding:MIME-Version: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=HxADCgy7af/zo4TiXSQqx6HCMZiUTkLMLlW1sthiMkY=; b=D JIALXGVwU/L08GChjnpGLpF8XeMvo3NTt97oait3Lff+w2JTa/gOK31vXlP/dtZZZDYiyZQB6LrdO PZIQyRHPvAGwjWG7rzjG5kSCE5F2uz4Iwlb8tvVI8fYoZBLlTPeZcz4uT7gvFykVgpkRSN2itgq7g Z9738Vm+/wmsJIDM=; Received: from outboundhk.mxmail.xiaomi.com ([207.226.244.122]) by sfi-mx-2.v28.lw.sourceforge.com with esmtp (Exim 4.95) id 1tQ3NB-0007kq-B9 for linux-f2fs-devel@lists.sourceforge.net; Tue, 24 Dec 2024 11:46:50 +0000 X-CSE-ConnectionGUID: XdUbetXRQjaQ/08qav5VTg== X-CSE-MsgGUID: LCWVIpo1Q+yZ0ki/oIt4Sw== X-IronPort-AV: E=Sophos;i="6.12,260,1728921600"; d="scan'208";a="129274206" To: Date: Tue, 24 Dec 2024 19:46:21 +0800 Message-ID: <20241224114621.1220350-1-zangyangyang1@xiaomi.com> X-Mailer: git-send-email 2.43.2 MIME-Version: 1.0 X-Originating-IP: [10.149.46.100] X-ClientProxiedBy: yz-mbx07.mioffice.cn (10.237.88.127) To bj-mbx11.mioffice.cn (10.237.8.131) X-Headers-End: 1tQ3NB-0007kq-B9 Subject: [f2fs-dev] [PATCH] f2fs: fix using wrong 'submitted' value in f2fs_write_cache_pages X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: zangyangyang1 via Linux-f2fs-devel From: zangyangyang1 Reply-To: zangyangyang1 Cc: jaegeuk@kernel.org, zangyangyang1 , linux-f2fs-devel@lists.sourceforge.net Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net When f2fs_write_single_data_page fails, f2fs_write_cache_pages will use the last 'submitted' value incorrectly, which will cause 'nwritten' and 'wbc->nr_to_write' calculation errors Signed-off-by: zangyangyang1 --- fs/f2fs/data.c | 1 + 1 file changed, 1 insertion(+) -- 2.43.2 #/******±¾Óʼþ¼°Æ丽¼þº¬ÓÐСÃ×¹«Ë¾µÄ±£ÃÜÐÅÏ¢£¬½öÏÞÓÚ·¢Ë͸øÉÏÃæµØÖ·ÖÐÁгöµÄ¸öÈË»òȺ×é¡£½ûÖ¹ÈκÎÆäËûÈËÒÔÈκÎÐÎʽʹÓ㨰üÀ¨µ«²»ÏÞÓÚÈ«²¿»ò²¿·ÖµØй¶¡¢¸´ÖÆ¡¢»òÉ¢·¢£©±¾ÓʼþÖеÄÐÅÏ¢¡£Èç¹ûÄú´íÊÕÁ˱¾Óʼþ£¬ÇëÄúÁ¢¼´µç»°»òÓʼþ֪ͨ·¢¼þÈ˲¢É¾³ý±¾Óʼþ£¡ This e-mail and its attachments contain confidential information from XIAOMI, which is intended only for the person or entity whose address is listed above. Any use of the information contained herein in any way (including, but not limited to, total or partial disclosure, reproduction, or dissemination) by persons other than the intended recipient(s) is prohibited. If you receive this e-mail in error, please notify the sender by phone or email immediately and delete it!******/# diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index 94f7b084f601..083acd7f5420 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -3179,6 +3179,7 @@ static int f2fs_write_cache_pages(struct address_space *mapping, continue; } #endif + submitted = 0; ret = f2fs_write_single_data_page(folio, &submitted, &bio, &last_block, wbc, io_type, 0, true);