From patchwork Mon Apr 26 22:05:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Junxiao Bi X-Patchwork-Id: 12225073 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A221BC433ED for ; Mon, 26 Apr 2021 22:07:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7FF46611BE for ; Mon, 26 Apr 2021 22:07:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235991AbhDZWIQ (ORCPT ); Mon, 26 Apr 2021 18:08:16 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:60180 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234497AbhDZWIL (ORCPT ); Mon, 26 Apr 2021 18:08:11 -0400 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 13QLxbeS063565; Mon, 26 Apr 2021 22:07:27 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : content-transfer-encoding : content-type : mime-version; s=corp-2020-01-29; bh=VAx7UlJBLJcEkpNko9PY2Nve7EX7DM2MKmi0fwuaFZU=; b=r56nw0jF+dIhH94hjE7IUtyEl57QZ/Fj/PbtqeOgNU/XKo7UmaeeLgfdVlA4P5m/qpEa zpt42VsHRAfB5rnnuaDEOe16HmZjDG+6Fx/RLBYNYf2VjoRthOwS7FEAnx7LsNvyfZAg gC7et581FlneMrANiJSun9d33evrFxkqmz90ewoYWa3Xm7jr0bCaIj8lHEHsSUrJ/81J XxvtLcZrN/RcogfgPy4rTRWjsrcr79QxI0VBdJjQwzDqhgX/gi/R9XmtlB0FrpXIVSUX R4k3F3OR3lwH9KQ1TWpr98QE17EJFmAhgEBhPqFqpuyiqlG1uZFgUUxdVedsGQeYmteI MQ== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by userp2130.oracle.com with ESMTP id 385afsuk4n-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 26 Apr 2021 22:07:26 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 13QM6Kld105544; Mon, 26 Apr 2021 22:07:26 GMT Received: from nam04-bn3-obe.outbound.protection.outlook.com (mail-bn3nam04lp2054.outbound.protection.outlook.com [104.47.46.54]) by userp3020.oracle.com with ESMTP id 384w3s65pu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 26 Apr 2021 22:07:26 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DQvZWaB5HlEZrKXrh2dQIyMzmPAcDiBRBtSmIENmX7L4TMyw2VNc2IaNcRoFky3UlXzf5CJKA42F3+reCgoTtlK//vsTZqPcSlgj9wuzXhz22aDOT8Df4gTrdCORa+EeVb31aSaCXmMJwcy8YOpbyT4xiCYGStYvluLTpo6V8C4VYfjKLX/fTmhs5pi1JjDAuP1CmZZLcZDOsvne71K2tOLkOfGup1Jge5zfzr08BoKRnX7EEpqTqtpOcEHU/DQ7ktKDPeS1jpmzk/s6/rAq5X+j9iHrk22ISkn1k5fb0O5u3WQiueRv3XbKXH80GlP6HMDHa1zHh9oiBsKGXrVbzw== 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-SenderADCheck; bh=VAx7UlJBLJcEkpNko9PY2Nve7EX7DM2MKmi0fwuaFZU=; b=AXwp/d6/DP0VCpRd5xNqSNqH1TQQKqu0EMaQy7z7KDLGZt0oLwVv5KfHrui1rx5a6bVtgWJZYU46cRWZWjoHjOoc6z5ZX66PvTASjZmqvoVcXC+g8mlFeUTqgQKPLyj8VOyNacFFwgcuXJ5WCTec3d2+nyG9zx20lhfmClxYe645vKJ1Lw/1UbfQqJJrnHQT+rtiS8BuiWlwPYUJDIROkK6/+aXGc+3VdfIayXidAAd/ADXzGq2UA2VXJru3izavoGECZqQzpGaB+//kdub0T4telQ5G+sCcH1wJHH27lyR1BGmuLadqYXVG5eQRvPtCNqXrrHbhc3HKXLJSk8D+YQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=VAx7UlJBLJcEkpNko9PY2Nve7EX7DM2MKmi0fwuaFZU=; b=Sv9Z7hBDikpmny97WdzKCHPjjfk2PIp6x+sh157DR4JZBtID/2+Ekaayrhuk0MTxbDcMUoJEVJFsbYQBqe+5Yx5O0WmF9USU4aARdEXbzo53XyskSTkWFvKMJvcB3Db9sf3bJUTjM0bgyqJ8K0oZJnZHacllMPvJ6n9W65aJNMY= Authentication-Results: oss.oracle.com; dkim=none (message not signed) header.d=none;oss.oracle.com; dmarc=none action=none header.from=oracle.com; Received: from SJ0PR10MB4752.namprd10.prod.outlook.com (2603:10b6:a03:2d7::19) by BY5PR10MB4307.namprd10.prod.outlook.com (2603:10b6:a03:212::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4042.19; Mon, 26 Apr 2021 22:07:24 +0000 Received: from SJ0PR10MB4752.namprd10.prod.outlook.com ([fe80::7865:7d35:9cee:363f]) by SJ0PR10MB4752.namprd10.prod.outlook.com ([fe80::7865:7d35:9cee:363f%5]) with mapi id 15.20.4065.027; Mon, 26 Apr 2021 22:07:24 +0000 From: Junxiao Bi To: ocfs2-devel@oss.oracle.com, cluster-devel@redhat.com, linux-fsdevel@vger.kernel.org Cc: junxiao.bi@oracle.com Subject: [PATCH 1/3] fs/buffer.c: add new api to allow eof writeback Date: Mon, 26 Apr 2021 15:05:50 -0700 Message-Id: <20210426220552.45413-1-junxiao.bi@oracle.com> X-Mailer: git-send-email 2.24.3 (Apple Git-128) X-Originating-IP: [73.231.9.254] X-ClientProxiedBy: SN6PR05CA0026.namprd05.prod.outlook.com (2603:10b6:805:de::39) To SJ0PR10MB4752.namprd10.prod.outlook.com (2603:10b6:a03:2d7::19) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from dhcp-10-159-151-113.vpn.oracle.com (73.231.9.254) by SN6PR05CA0026.namprd05.prod.outlook.com (2603:10b6:805:de::39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4087.16 via Frontend Transport; Mon, 26 Apr 2021 22:07:23 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f0e7a9d6-7dfb-41e4-2b4e-08d908ffabb3 X-MS-TrafficTypeDiagnostic: BY5PR10MB4307: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7219; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: JCm1z0+6b1zuGy5r9LSdvAmxQhmEUu6SlYfOHQ6HpJcFmlO8cJCHOcaNQ6QamiVmJD4uhuHDaHGE04vgN//34xGS4ItTiOgS40WJFhviQdrhbWYP/xgsBk9t9ykXrvGJcIslRE5d/EIwOuVnM87oBSFyxqY7cQLQmfU3XSHY8Fk/llJJaUkc8e8OoIFXmmwPoY0OrnSil6cxvTcevNU6H83PFZpTe3iKOo7c+J9EIw+h9qbPL7Alk3wJB+bI6wnCfMPXsujYp+fsprMukxdsLQ4h0xaNb3TCqPKsUmIb9/nDzxM/TSmTUAsrmIy1YJ/oX3kmGQIbD/Q0x6NX8QJwEcgHY821yZZcFENijR5zsin/DmaJXM+1T9XguOqbpn+vJotRG7N4WZYOs+lRsewHWhWrGu832SwvN+K1srGASxet5+r9ByDay790C+csb9AMamDqmR27PfOTEXLXf5KwCwRHpZEP2MqW/8/3wgIwBIFXAI/Gr4AjvHmySpdmOSTwa6YsGaPQOczvgE0Aux1yr1lHgC2KLMNqsZxumwzji3w54j+d1UvMAm9BrdCnVuEfNAY9QU4GZM8AMrheO0ZGm6FnGjeADo+ME/frApBvRpMZA5hT/Uiia945HhpYoPkhvxjmQG4o1qZfTfWbjt/RKw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR10MB4752.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(396003)(376002)(346002)(39860400002)(366004)(136003)(6486002)(6666004)(44832011)(5660300002)(478600001)(2906002)(66556008)(52116002)(4326008)(36756003)(83380400001)(38350700002)(86362001)(107886003)(26005)(956004)(2616005)(316002)(8676002)(16526019)(1076003)(38100700002)(8936002)(7696005)(66476007)(66946007)(186003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: ca6vXAHUWEO1umxIvaUDG/QKTSImuog68hRpAxvVHkLmRkBEEWj5ECKtMJLygJwKQ5qv4uQHpUaJUUSwhqXvDTCop0swrncrgMeJmbuSSy10hZHgEndL0HbLEyNELNPo1JaaXgWP3ptp3OJmnNdZgR+RvKpWe742PziIJv0R4kUC1XED89EaGTS+7o9mrz/UK/KgSRukVQRP/cmBhNIVhyw28D/1nU7wyrlF5CNWa+6gbk4tDGwWp1L1+1CBfMKpk3EBcFGwkPtBzr40Hfen+HyUQm/AHwU98Et8CbDoOaL5Z6mcxzfNFxtStkM+QjvQjAwINAvEs01iUqLJ/K/CnRa/uTpm/vh/tLIiBwKV7RexTRFPsYHWuw42LAQUUih1JkFJH1G3iWTluqfmqwfNvmsT493ZEEVNkh6heYwtgX2j4JqFx9jl5JPWddEmaSJBB04mNOc/T+7uu6VAUAQz2khZElkW3xVXxknW4XsY83pnYDU4uyB5MlPjhCPD1k56BVR8lUOTOZ04pSGYC4D9i3aiU+0a4ke7SvZXhiyZp/RAgKWShshxt2mL4un89240CMLCGe9a7T2DhKO4YG5q9fGUCfW7KNy0dPhErKxr3Ah+maON7zeuoy6MVx3Rq/n+dokTddXUIeOm+jU6CjRCIYqhwalTiNdug5ZFrR2jxVq4HlVa+W31jzftVUa3wVm+OwX2slgMD0VGx71z8S5IGLQdS4Fv7Dnkd0/dYN9ghnhoxnJMNusWla+MjErYZynEpTzkOAHY02gS0zpl9UszNFcoS6X/1QzznEpTZDLw2pz51PF9nMZOH3ricn0PY8kY2xUCrSpVfsIWugYXTX3T51/euhhhEnek6OyMvC2PtVOeKXKgWT2S8c0CC8ITO1wFRiqftKiSeIAuvbgolkhoo6I22U7M6Y6hGyiUBWAq3HK14Bey2N8tsuvb9mtrmSveot5cbqVSQHOr8i+zxy7XtyNmPXUH3SP55oPhWCpZj3uurFCTZp3tIlpvpc3JZHIPL/RrGYXfsGoWecCj3Fqet42cMT1k3Nezgr3V8Yxp9SElKpXj7ejfYBbVF/Y0TBzYoSiROVM/zggbRCzIGVUe8uinmTf9Y+zaJy/I+WUt76UGl1yjuC2YWhviit9Ekq38kPj7UHCO0Qk2gLYPGvUpjGP/UnAhUJkUbhUGmUbaByb7zpoFXt5PvE3nW7s9d87Qi6bRU+O5SFi6NenDRBayY8lcMprkl9AAl3rKhvNedAYTyo5kF1IkOytxkEvBo18sWSWcT7gh39sUWdwgyE3nWiwhf0Yc8kKPaTMAOGxoGEuCyAc8lAG7gLE4MQ5mGK4q X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: f0e7a9d6-7dfb-41e4-2b4e-08d908ffabb3 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR10MB4752.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Apr 2021 22:07:24.2204 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: snLY8rZffYOjsGQC0zOLdHBspCuyTAIkdH+8UH/3c7TK1tzASA8A/o/dJA9lkyvNMV/XhOPJFhn/0kULeqaeWQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR10MB4307 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9966 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 malwarescore=0 mlxscore=0 mlxlogscore=999 bulkscore=0 phishscore=0 spamscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104060000 definitions=main-2104260167 X-Proofpoint-GUID: 1LFIfHEUzqo_M-tC2YlEiXp7-Iir2L2e X-Proofpoint-ORIG-GUID: 1LFIfHEUzqo_M-tC2YlEiXp7-Iir2L2e X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9966 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 impostorscore=0 lowpriorityscore=0 mlxlogscore=999 malwarescore=0 phishscore=0 priorityscore=1501 clxscore=1011 spamscore=0 bulkscore=0 suspectscore=0 adultscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104060000 definitions=main-2104260166 Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org When doing truncate/fallocate for some filesytem like ocfs2, it will zero some pages that are out of inode size and then later update the inode size, so it needs this api to writeback eof pages. Cc: Signed-off-by: Junxiao Bi Reviewed-by: Joseph Qi --- fs/buffer.c | 14 +++++++++++--- include/linux/buffer_head.h | 3 +++ 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/fs/buffer.c b/fs/buffer.c index 0cb7ffd4977c..802f0bacdbde 100644 --- a/fs/buffer.c +++ b/fs/buffer.c @@ -1709,9 +1709,9 @@ static struct buffer_head *create_page_buffers(struct page *page, struct inode * * WB_SYNC_ALL, the writes are posted using REQ_SYNC; this * causes the writes to be flagged as synchronous writes. */ -int __block_write_full_page(struct inode *inode, struct page *page, +int __block_write_full_page_eof(struct inode *inode, struct page *page, get_block_t *get_block, struct writeback_control *wbc, - bh_end_io_t *handler) + bh_end_io_t *handler, bool eof_write) { int err; sector_t block; @@ -1746,7 +1746,7 @@ int __block_write_full_page(struct inode *inode, struct page *page, * handle any aliases from the underlying blockdev's mapping. */ do { - if (block > last_block) { + if (block > last_block && !eof_write) { /* * mapped buffers outside i_size will occur, because * this page can be outside i_size when there is a @@ -1871,6 +1871,14 @@ int __block_write_full_page(struct inode *inode, struct page *page, unlock_page(page); goto done; } +EXPORT_SYMBOL(__block_write_full_page_eof); + +int __block_write_full_page(struct inode *inode, struct page *page, + get_block_t *get_block, struct writeback_control *wbc, + bh_end_io_t *handler) +{ + return __block_write_full_page_eof(inode, page, get_block, wbc, handler, false); +} EXPORT_SYMBOL(__block_write_full_page); /* diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h index 6b47f94378c5..5da15a1ba15c 100644 --- a/include/linux/buffer_head.h +++ b/include/linux/buffer_head.h @@ -221,6 +221,9 @@ int block_write_full_page(struct page *page, get_block_t *get_block, int __block_write_full_page(struct inode *inode, struct page *page, get_block_t *get_block, struct writeback_control *wbc, bh_end_io_t *handler); +int __block_write_full_page_eof(struct inode *inode, struct page *page, + get_block_t *get_block, struct writeback_control *wbc, + bh_end_io_t *handler, bool eof_write); int block_read_full_page(struct page*, get_block_t*); int block_is_partially_uptodate(struct page *page, unsigned long from, unsigned long count); From patchwork Mon Apr 26 22:05:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Junxiao Bi X-Patchwork-Id: 12225075 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D0D75C433B4 for ; Mon, 26 Apr 2021 22:07:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A84DF60FF1 for ; Mon, 26 Apr 2021 22:07:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235509AbhDZWIR (ORCPT ); Mon, 26 Apr 2021 18:08:17 -0400 Received: from aserp2130.oracle.com ([141.146.126.79]:49410 "EHLO aserp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235538AbhDZWIN (ORCPT ); Mon, 26 Apr 2021 18:08:13 -0400 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 13QM0VgC115653; Mon, 26 Apr 2021 22:07:29 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2020-01-29; bh=laIkdfWVNsl4N4zcL8amigZZXhtf0a9Umv8mzGbfcQY=; b=Uw64mhEFu7m+ORUTBDU+Qsw+ChjbnucSYxRlFB/hwN2EERsKwa5RYzd6UtBgQ2Tq1xfW QjOxc3/IyFGTNtNRpYXGH1nEFQua0HYj5oXY553JpUWKdSfcIKnQ5wkgT1xAt3igsKoV GraF5s3OcIv8MZfBrfrP868tjitbP5oJcdbc59B3Zm7DGbOmE1ma9ZXd8LZqE1xBj9u9 NS8UJQVmW6ZmFPS2bh0Rt6K3I07XYZ/G28SlU/Qv3hitUc6a8VbbBRw5rM/FejofvamK 3OR0dYTZGue8J1dRVbNTInDcBJlu+I6ijP/vTCuc0tu7IVsRxvXCDqTtwqquV+RnL3DI dQ== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by aserp2130.oracle.com with ESMTP id 385afpuksg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 26 Apr 2021 22:07:29 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 13QM6Klg105544; Mon, 26 Apr 2021 22:07:28 GMT Received: from nam04-bn3-obe.outbound.protection.outlook.com (mail-bn3nam04lp2054.outbound.protection.outlook.com [104.47.46.54]) by userp3020.oracle.com with ESMTP id 384w3s65pu-4 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 26 Apr 2021 22:07:28 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DaX++mq0H+xsROZL7Suo0MLmII26XFKqOr8NwmJgAxEtvFgMlc22sg9PR7WAeR7Bn6RhyUgFa534dvlw127O7eQ8ZVPmTnQD9GP9zokuxpJvi+x84aAHSTDiGwqJAYHYuk2+SaTOSIHwmX/QXCSqLInjG3OZNnGqTZfngN6BYgADBrXCoC7BAZU1ttPbVDl5HIwXL6VlW5uwIaHntEJr0B1/o8TCq7DinvicdAIrAGWXWgKm5PV5uIulWPKvOs/tsTxChb3lQi+6hQ8fzhyZR8OVDZ77StJv5PpBYbS0EuVfypTObZqjKWNw5U/vk5EDIucL4sSBFKK6ZewbkwkYaw== 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-SenderADCheck; bh=laIkdfWVNsl4N4zcL8amigZZXhtf0a9Umv8mzGbfcQY=; b=NW4wQvIK414gU4fvbBWbFyO6pq8Jj8IEuDHFS3fDjEuRlkMN4msJaansGD+dPg1plfJ0qN6C9x/05izczfcrLl6G6KbUXanVIh5jmCO+VuWm3txW022Maa6MKh73s4DnupIQzMpY4+4grLI3aipT+vJ3XiLtfDf3qL7mvpY//Vu2zx2oNQ4AFwCz1z2L5JFAzMho2moYXYPpJI8vnqNmDqc5wNRIpIik0rdcW5y9xsNSO7LXnMARCwnDxXsHFj9hlUsIWLnRDT1hBSM7fcCUxgXFtFWyxcBKWlzde4xHkFzYzFjjESShoONbpepX+2l0GDdqJqek2IQqpUxLGRZDyQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=laIkdfWVNsl4N4zcL8amigZZXhtf0a9Umv8mzGbfcQY=; b=UXrhHhL/H6fhHOQbuv5wUXdbfw8jnBMMiqmLb2VW3sQFD7CKBLFggXE44wjlwOS70/H4094PRD3CnKJQ8YkT/0OncMIi7b6EBZMC6Hk0KUVBAZQUsSSxZMuwHhboEhsBoeIEoWFhAEZdm+qvEGhvckUkUOmJYydFWAaYAwXvqaE= Authentication-Results: oss.oracle.com; dkim=none (message not signed) header.d=none;oss.oracle.com; dmarc=none action=none header.from=oracle.com; Received: from SJ0PR10MB4752.namprd10.prod.outlook.com (2603:10b6:a03:2d7::19) by BY5PR10MB4307.namprd10.prod.outlook.com (2603:10b6:a03:212::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4042.19; Mon, 26 Apr 2021 22:07:25 +0000 Received: from SJ0PR10MB4752.namprd10.prod.outlook.com ([fe80::7865:7d35:9cee:363f]) by SJ0PR10MB4752.namprd10.prod.outlook.com ([fe80::7865:7d35:9cee:363f%5]) with mapi id 15.20.4065.027; Mon, 26 Apr 2021 22:07:25 +0000 From: Junxiao Bi To: ocfs2-devel@oss.oracle.com, cluster-devel@redhat.com, linux-fsdevel@vger.kernel.org Cc: junxiao.bi@oracle.com Subject: [PATCH 2/3] ocfs2: allow writing back pages out of inode size Date: Mon, 26 Apr 2021 15:05:51 -0700 Message-Id: <20210426220552.45413-2-junxiao.bi@oracle.com> X-Mailer: git-send-email 2.24.3 (Apple Git-128) In-Reply-To: <20210426220552.45413-1-junxiao.bi@oracle.com> References: <20210426220552.45413-1-junxiao.bi@oracle.com> X-Originating-IP: [73.231.9.254] X-ClientProxiedBy: SN6PR05CA0026.namprd05.prod.outlook.com (2603:10b6:805:de::39) To SJ0PR10MB4752.namprd10.prod.outlook.com (2603:10b6:a03:2d7::19) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from dhcp-10-159-151-113.vpn.oracle.com (73.231.9.254) by SN6PR05CA0026.namprd05.prod.outlook.com (2603:10b6:805:de::39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4087.16 via Frontend Transport; Mon, 26 Apr 2021 22:07:24 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2a8e2d37-4503-4b06-f203-08d908ffac6e X-MS-TrafficTypeDiagnostic: BY5PR10MB4307: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: zHVKO/nMN4+N7PsK3S0CfHI9lMCaKNw+qUiO0/JaVU5UZTXPnKCdvQ4RI0oigmwJsxE5uRJiUyB0ki7vFK3rbNqdaHxh+/uUwX/epj9Xi4sS6rY6LqYRg1HaLcqpK6h2Ir4wwtV02yMfo7YOCu2c7Ic8JxtEtwtps0RBMIsSnEYXH93vw/zri+vlYec8SSyHT5IjGJwOKcwcF5rCe6XCE9uTjx13Mmn+R2Zt0q/S19/Zgl8XpTps3Gg7luvn1ctgE5kqhzowQDm8zzCEyEdsHISxl4FA47EdoZDhLn8R0GNEC8w9kFlzyMoAXKfnTFLTEVz8h71g69SmHgoN7adJmCM4NwQ2ewr3ScLpfWLEImwHpdzGHSLBgsaCTQ8uAzFDyu1LAJKFuAEBwKLNEqpLW4Fo4PQczRJyIq37NDORikn8iqVPNPYgTI1EWijTAaPckrFTU27RPpAJYFFjEel9JMs9Azg7Q3VqteQvMRvL9dxgt/TkknKqwZvF9vZUkSPRyXe7b6D2RkCwHsLMaUHr5yiUK/I/T0M9TXjkMpU8si8EQv/pOLcdyQqh9NNEsv6uM6jCttp0eJKFhoLMdOu/LeOLanHRlKhH5Kse8tpm8971G6bM19jFFSyr0ZSN0UzLhs3wDbgFpOhWzeslG5FLzjZLDKspDnJyA3HIkFt/DL4= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR10MB4752.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(396003)(376002)(346002)(39860400002)(366004)(136003)(6486002)(6666004)(44832011)(5660300002)(478600001)(2906002)(66556008)(52116002)(4326008)(36756003)(83380400001)(38350700002)(86362001)(107886003)(26005)(956004)(2616005)(316002)(8676002)(16526019)(1076003)(38100700002)(8936002)(7696005)(66476007)(66946007)(186003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: cFNHjP5FUdIFbj93xG43IRskHQROlJVnJgqZgABWdzpeVVLyKudfwwNrkjXXvMnbDxNE+WilVTtJKSnnlYTBj3PyM2yUhZc0lxrr2qjo6kWMeMF/6GFWzxiKIoJC9VA2GU3SZwgcQp3/9x30F57eNI1Y8pSW8HmdrAeLQV7TUrs9FDwDrWEmoT4Qu2n/Wgo9t9buM5HKAA9jnqzaAWlRU3PJ+i0ATORiJKZ8K90ShiAAnDmlttBqjz1yjS2DgdtZegwWbIXg8CAK+gRntczX6QFujD9avHo+2hlNi6WmH67ss7GrLJ2ehqqx3JiRzrfTO8rhhwFXH+I5thKrBxFCmrYFd30o9eHsrPvyHcZVKxrP494ol5MpLAsS0x45aImU2hWGqqnPlIYHNplcQ/CfEHtNB8dwkupcRgbLLazIPVuIwdYiQ0aILgeWi083oERej/5H7WLis5P189Swdt1tkx/AH2odZ6S3xK89xkC6aDHFQFWs+p+vZMvDKYoZnk2G8uDZJ5yM9VWDNIwmVPd+sszva3FquZns0SMeA3BPMP48abMSj4/2VjRqeD4QYpI39PjCPOx4N8dvK3oCuXF0l/2ydB4lPy9/i995eHdBLLsRsbLTKyL//oF8n3au/p1qBUZTgU7Z9yweYwW8ZF7B5+TXUYiY3JIax/Uhm4tddcWNRn60jVA4ur+AYrza2QrwxyC/bM4K+r9bbGL2Kl8JowjKAlXPhDYA/h+j2cd5rdGpvK2ChM2g05PXdqSF7LtdRcSFB+q6uIJrGAjtH276FNkCGlKi7PHRTVIQKkTlaRhA8zKFXBwIRoHyK0mg9NOcAsOpHKPCxMDj4kznibm36BzgV9ajGP4mA/PG74ZC6ltDKHJemeItmdl6Y1cxLwLt6oz3WRiksc39IydX1wdEL1xZ4XlaP9Qe/ZtebH9v1AMqMD5Y/DawyBlQbGl/sKnAPFmpZR1uo2Hl6SELXKDHWjCrLwOPSo+HP8g19m7gy9gZYpSNaXk52mdwrD1Dpg9Rv4KyABLkKEju6dzco0pjl+3q0onCnFulkL58MOujxV6rlVWGEpVfnRCxDg3seHewzCW5JYlLM5G4c1I1zonI41IIjzq9Io2qBX41CPeCAQ1edwWnhvk0DiiuPq1nIAl726TVsOqCgDHEnfL3oiwZy+OHjf0fNGDeVC1qV/wjewaPeLZRrva4GcOWfghHig66w9bgTP4DsSDnYlOsKFQa46C3H6T3AvmlDnJ/f0ZIlFtTw1eToh+bKIXv/BM9JQIAOt17W+xpZhO40lpu3uc23cezr7La2XqO2sKswqWnYOwachgzb2B/fllPXKBbcbol X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2a8e2d37-4503-4b06-f203-08d908ffac6e X-MS-Exchange-CrossTenant-AuthSource: SJ0PR10MB4752.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Apr 2021 22:07:25.3863 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: rv8xsTrN/O+NCzFaHs19l22ZD6yrK3wBAt7Blb2gKtFX1jW2QeHUoTvhSFEp+rVtP9Bomygel5Js5XujDAd3rQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR10MB4307 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9966 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 malwarescore=0 mlxscore=0 mlxlogscore=999 bulkscore=0 phishscore=0 spamscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104060000 definitions=main-2104260167 X-Proofpoint-ORIG-GUID: BnD2L5VtgzJF3N2jLH86hRjYErerrUaw X-Proofpoint-GUID: BnD2L5VtgzJF3N2jLH86hRjYErerrUaw X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9966 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 spamscore=0 phishscore=0 clxscore=1015 suspectscore=0 lowpriorityscore=0 mlxlogscore=999 mlxscore=0 adultscore=0 malwarescore=0 impostorscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104060000 definitions=main-2104260166 Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org When fallocate/truncate extend inode size, if the original isize is in the middle of last cluster, then the part from isize to the end of the cluster needs to be zeroed with buffer write, at that time isize is not yet updated to match the new size, if writeback is kicked in, it will invoke ocfs2_writepage()->block_write_full_page() where the pages out of inode size will be dropped. That will cause file corruption. Running the following command with qemu-image 4.2.1 can get a corrupted coverted image file easily. qemu-img convert -p -t none -T none -f qcow2 $qcow_image \ -O qcow2 -o compat=1.1 $qcow_image.conv Cc: Signed-off-by: Junxiao Bi Reviewed-by: Joseph Qi --- fs/ocfs2/aops.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/fs/ocfs2/aops.c b/fs/ocfs2/aops.c index ad20403b383f..7a3e3d59f6a9 100644 --- a/fs/ocfs2/aops.c +++ b/fs/ocfs2/aops.c @@ -402,11 +402,28 @@ static void ocfs2_readahead(struct readahead_control *rac) */ static int ocfs2_writepage(struct page *page, struct writeback_control *wbc) { + struct inode * const inode = page->mapping->host; + loff_t i_size = i_size_read(inode); + const pgoff_t end_index = i_size >> PAGE_SHIFT; + unsigned int offset; + trace_ocfs2_writepage( (unsigned long long)OCFS2_I(page->mapping->host)->ip_blkno, page->index); - return block_write_full_page(page, ocfs2_get_block, wbc); + /* + * The page straddles i_size. It must be zeroed out on each and every + * writepage invocation because it may be mmapped. "A file is mapped + * in multiples of the page size. For a file that is not a multiple of + * the page size, the remaining memory is zeroed when mapped, and + * writes to that region are not written out to the file." + */ + offset = i_size & (PAGE_SIZE-1); + if (page->index == end_index && offset) + zero_user_segment(page, offset, PAGE_SIZE); + + return __block_write_full_page_eof(inode, page, ocfs2_get_block, wbc, + end_buffer_async_write, true); } /* Taken from ext3. We don't necessarily need the full blown From patchwork Mon Apr 26 22:05:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Junxiao Bi X-Patchwork-Id: 12225077 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A99F9C43460 for ; Mon, 26 Apr 2021 22:07:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 804286127A for ; Mon, 26 Apr 2021 22:07:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236012AbhDZWIS (ORCPT ); Mon, 26 Apr 2021 18:08:18 -0400 Received: from aserp2120.oracle.com ([141.146.126.78]:34850 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232062AbhDZWIO (ORCPT ); Mon, 26 Apr 2021 18:08:14 -0400 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 13QLxgDj080831; Mon, 26 Apr 2021 22:07:30 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2020-01-29; bh=kOI1/jG4tx6HSqiE1AFRt0kX1WHLPj3Q/Mqf5omPxHQ=; b=zN1A2xVJgviJrYs6vQ3tXm0PvUM2s2T6weyd5k4KJhgtrpssJ2yFljm47TmaAeBI41Zb hl9T06tKbno/jWx/4SS/WBZrK7LuSVpS3V9XTBTXEpu5PtoK3VYMyte6cMhSFohYNbOj iqFzWNeNHZi7TaclC96CwxolaMrpQNlk8ViuNcr+sKE7QuQlJ9hKr4JvAn60C6hmL1NT +jJj6kqNKjnoHzHEctpFGtjsyd89eU2VObfrAywtOvZrX1PxlKzeQ4pVUqkQN0I8ECgM TwFSzZwdQoeW8fZwRAIKFOFVtRQa3a0sMerIHvANCAMcoSZojecWZ7IurAg3WbF+esmI 3Q== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by aserp2120.oracle.com with ESMTP id 385ahbkk8j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 26 Apr 2021 22:07:30 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 13QM6Kli105544; Mon, 26 Apr 2021 22:07:29 GMT Received: from nam04-bn3-obe.outbound.protection.outlook.com (mail-bn3nam04lp2054.outbound.protection.outlook.com [104.47.46.54]) by userp3020.oracle.com with ESMTP id 384w3s65pu-6 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 26 Apr 2021 22:07:29 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bfyHO/QnH0VbHqXs7mzJeY3If4+ZHVCpyk+9pcv2M/51lYgWvx0tdjWWt2BK+4wl/jlSYifLAPrfHr3CAzLtD3NbZhMCeO4Ki1NHLSgp/BhW9Agu7OVQtq8kDw/KqX/NUecoes1k5kWesMLUcy4WI0lf1k65K9/li8+HuNPoAQABtmnaZrZjgNYo7W9f37rKIzjpfScC60VL8VEnpFiOhZ7qkM/bAnw77D84nSOkyld6CJWIPweUNUv32FTpm7F+E1A0y4kLzX8Vv5PlGG26ZaHwnDeR9AnUWFQYVEqpw3H+6/+ToI1RiGH5JHG3HKCejOyJdOBRDj3YpO90be6Wvg== 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-SenderADCheck; bh=kOI1/jG4tx6HSqiE1AFRt0kX1WHLPj3Q/Mqf5omPxHQ=; b=RsGOjlOwi3yg7BavCb1dVIUL9ySK27ahOAYF7RTPz4LTOlqb1tvMXxF2sBsWl5L33TJDzGHVND+kKt2OZN6bGySLaJdFRSH16H6HONvjoRe4MD0hlI4Eq/q2OX8jLMIRAZEY19mSR9pvQHo+KCjl6IqP6haTsPainA3LULkJD1LrDd1wPFwAEbIrCCSMr/jHwoqdhCAo4LFBAgf+w1vunbmQIU+7r1r/82gyEA+cTbktSZl/XSo0JOXpQkHCUiT5ZHpdKJ1/tSLqf3JvVtXS4ryYaEQ0w+VPsKKBnzvU48HjXdGOKVCRHidvfQ8rHKp1HZy5AjCEZmRyWkKEKPeeTQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=kOI1/jG4tx6HSqiE1AFRt0kX1WHLPj3Q/Mqf5omPxHQ=; b=T7Ty2caDwvdhxZ+WyFIeqNAFQjxA496RKBJDpX+Fi2jJaclVZtdX84psykIPeaokdFb2RIq2oB7JZpsjV2GrkUNyPs5aBkwcREp/WFBBudznYAuZ9mNjQT88LH68TG6nA4ioBlnjyEsVQLMLTW8LQs2vaTbOrLQVrp0JaDYySS4= Authentication-Results: oss.oracle.com; dkim=none (message not signed) header.d=none;oss.oracle.com; dmarc=none action=none header.from=oracle.com; Received: from SJ0PR10MB4752.namprd10.prod.outlook.com (2603:10b6:a03:2d7::19) by BY5PR10MB4307.namprd10.prod.outlook.com (2603:10b6:a03:212::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4042.19; Mon, 26 Apr 2021 22:07:26 +0000 Received: from SJ0PR10MB4752.namprd10.prod.outlook.com ([fe80::7865:7d35:9cee:363f]) by SJ0PR10MB4752.namprd10.prod.outlook.com ([fe80::7865:7d35:9cee:363f%5]) with mapi id 15.20.4065.027; Mon, 26 Apr 2021 22:07:26 +0000 From: Junxiao Bi To: ocfs2-devel@oss.oracle.com, cluster-devel@redhat.com, linux-fsdevel@vger.kernel.org Cc: junxiao.bi@oracle.com Subject: [PATCH 3/3] gfs2: fix out of inode size writeback Date: Mon, 26 Apr 2021 15:05:52 -0700 Message-Id: <20210426220552.45413-3-junxiao.bi@oracle.com> X-Mailer: git-send-email 2.24.3 (Apple Git-128) In-Reply-To: <20210426220552.45413-1-junxiao.bi@oracle.com> References: <20210426220552.45413-1-junxiao.bi@oracle.com> X-Originating-IP: [73.231.9.254] X-ClientProxiedBy: SN6PR05CA0026.namprd05.prod.outlook.com (2603:10b6:805:de::39) To SJ0PR10MB4752.namprd10.prod.outlook.com (2603:10b6:a03:2d7::19) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from dhcp-10-159-151-113.vpn.oracle.com (73.231.9.254) by SN6PR05CA0026.namprd05.prod.outlook.com (2603:10b6:805:de::39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4087.16 via Frontend Transport; Mon, 26 Apr 2021 22:07:25 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 437b5311-e205-4d22-619f-08d908ffad33 X-MS-TrafficTypeDiagnostic: BY5PR10MB4307: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:983; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: E3563R/10UTPyrmNSTiDTgafHe7Q3aZWp9OIPGLDA1MZl/A+ymtbh0fLDmlEgr+TPOtfwCt3QAnKb0r1MakBP2waKYIvtrcYGOM2ZtSEDUlxj90/sO89dboO6pCLSlyTSK5j4ARSHOkIoj+xehZXPDsy/UgOR+qiTaiUAgJ2OVx8/+dlbUD72rZkV2bLdsK2w4VhRt/1ByC9PKAOkayg3+LBLQ8qSB/psXtLj5QXFfnCOlqsKtaWmmOq/Wb7Bawi7nPGGpWLgpFxTq337gyGbpTdHgRXEPGPddPjf6THuiQJ4QdueSBU4ihVDFkmjxXtbLmi3Z2L76uG/ye3gyyg01TmusJb4B25qvPVZE13fSw8Sis3RDjIRTrSiq3mqao6oW9TwpqYgzyh2zPkDPTOKB7JHGbRrppc4CiWc408nDQCVQD7Gw1OKARsbrjjXXPDxtgseqQLPJ05/wM35mDa9M68lsYif0Bos/Gn46U3hOammoRGFaM3nkGaJVVlCs/nZq/SNzwcZMhKLReYt8DUIF4M47M8oUExh7X3NB/iyo2Dvnp+tYZscvVAdLHUpsENCR5lw4gWvewu0keuPe69ZnLF6UQRlckvJz5a8oFmp4MCeOWwHWIOSExcHyczvJW2TdaLcilXNLrcbP4hz28GIGgBRrA2kZx6FBpJvBofrRY= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR10MB4752.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(396003)(376002)(346002)(39860400002)(366004)(136003)(6486002)(6666004)(4744005)(44832011)(5660300002)(478600001)(2906002)(66556008)(52116002)(4326008)(36756003)(83380400001)(38350700002)(86362001)(107886003)(26005)(956004)(2616005)(316002)(8676002)(16526019)(1076003)(38100700002)(8936002)(7696005)(66476007)(66946007)(186003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: SYJyfE8DDXUmEEYW/WWlB+vpPILtTWRe0Toc9hp/3Zj2I291rylSDAzkFtJwWqkD6TeE5viW28i3C4sY2agGAgco1dxIwtxhLRkgbKq+zb7jHIybASK0dpbbQzfnP8IdHtD04g8PymfvsmGYVJbfuUV8t+4WrSqT6cQjTlK6hb+glvx0SOh7AutRHooU6XtAT6tsS6TPHeEHylXKicgpc5N0seCrf+pW7t2TGKyk6mr7RX9TACKHOAQ5lvi161p5a8UP6G/rzLweVbtHLq0G9PSZy5sGAzygutdr9/WDmOSzRLiyUQJeDG09CtAN7fjB/1SxTJBv1wYmTWC6atJ9KeCarRG488ddRjKZdlUiKBeTqV1N4ZlDQQI8TRYztXsd4ux5M9oAz7Efl1ymUTBlFwFhxSpPrxPDCykO9PYrpK/L1Eh393nYRItuVFN00bEQ1wvAiXjBZgMa/u/OqGStpCaNW5XBYWFXmdZzstvf+hrWM/mtugXdro9KxXJFK75k8N6Z6DFavyY32+Sb0u7IYZua8nE4wTL/FEGlj8CQ4jgzieXNAV13u6K6w/MgP4mBZHbb05u7WoLfP7CJswNJLkiu6MtxulWnoxSWsMAyvOoQ9fEUvTLIvY5BZzVkHSCqze9WGg5Ynb+6ejs+N+enSp1MjTPo+Dm9Dnhqibi/AQXy0SZtPEXIeoVGmKlPsTrrsoSoM+oDt+t0vN9c9BBzuYLLsFvCXahkNaqDKwc2sRmw58OOuuRfnxYUk+WfQn8tGAwxrrp0899fdMJmsDjHJEf/mk0rKvIXiuacli7xut7VhAsb13TNM2dE4grJDRrXI9i4nLMpr3RrlVjNPvCu76OfXV58gPPv6hiR6RBJF7ExOYXY8m5YSyxh7uSFdug2pmWBgoU96RIEgYOwFumKOOaQajNGB6XjwrdyyWT0gYah2bebSYmZwS9wVCJmB5ZWQe52HnGJ1mx+CM/zfbGl2LGUxxU/HPifnX27vheF1EhjYQ4sV2H0qMd8CaseQU0C777jP06j1Khrqisv73JnNKw8qJme8BxI4XwlBE99wDp6jmBgWrQpkHTs7xTm9KvNdHtifzIJ/cXrT4u29V/+IhNKv21v9avGw/HB3KVltEJFdMoNJoujhtQElsf20kJPnJFUpFCi+OJW0buQFvoDFFxK7BTFosqfO4vcZCPPcT6UnSheXWrPJaKBkGFQ32wwMS4Kap84zJDNwPH//h9QELrZBYoo0KVmsdrVbwaW/5/WIpSiVt3E3jdk5NlhxvdeaEPQMahKqnG7+W2o19OT6x27Ro9gcsWDIzUvZqtPQJ6e5a/u+GKT5hNViBkMDQro X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 437b5311-e205-4d22-619f-08d908ffad33 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR10MB4752.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Apr 2021 22:07:26.6806 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: AV2nH1kgmO15bSd33q5EULvTf6tmN7l6AXVOY4eg7O+YjuEZK1TRAVjsiU9PftSbml5PxPsAB6/8l0aTUbZ6uA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR10MB4307 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9966 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 malwarescore=0 mlxscore=0 mlxlogscore=999 bulkscore=0 phishscore=0 spamscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104060000 definitions=main-2104260167 X-Proofpoint-GUID: kgpF6frZziYuiZ1zwB3wCZEF0kH0xbys X-Proofpoint-ORIG-GUID: kgpF6frZziYuiZ1zwB3wCZEF0kH0xbys X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9966 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 bulkscore=0 mlxlogscore=999 priorityscore=1501 clxscore=1015 adultscore=0 suspectscore=0 spamscore=0 phishscore=0 malwarescore=0 lowpriorityscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104060000 definitions=main-2104260166 Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org Dirty flag of buffers out of inode size will be cleared and will not be writeback. Cc: Signed-off-by: Junxiao Bi --- fs/gfs2/aops.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/gfs2/aops.c b/fs/gfs2/aops.c index cc4f987687f3..cd8a87555b3a 100644 --- a/fs/gfs2/aops.c +++ b/fs/gfs2/aops.c @@ -133,8 +133,8 @@ static int gfs2_write_jdata_page(struct page *page, if (page->index == end_index && offset) zero_user_segment(page, offset, PAGE_SIZE); - return __block_write_full_page(inode, page, gfs2_get_block_noalloc, wbc, - end_buffer_async_write); + return __block_write_full_page_eof(inode, page, gfs2_get_block_noalloc, wbc, + end_buffer_async_write, true); } /**