From mboxrd@z Thu Jan 1 00:00:00 1970 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7ABA5C77B75 for ; Sat, 6 May 2023 05:51:51 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D2A136B0072; Sat, 6 May 2023 01:51:50 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CB3FF6B0078; Sat, 6 May 2023 01:51:50 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B7B1F6B007B; Sat, 6 May 2023 01:51:50 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by kanga.kvack.org (Postfix) with ESMTP id A274F6B0072 for ; Sat, 6 May 2023 01:51:50 -0400 (EDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 135CB5C00BC; Sat, 6 May 2023 01:51:50 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Sat, 06 May 2023 01:51:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kroah.com; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm3; t=1683352310; x=1683438710; bh=NF ynHyiGKZDQAJtL0CirqWpcs9b5k8E5/94VkrnAK0Y=; b=TxHbFunhGnMOZFmzpU NI84NUJG+kOjg7yvn/y/lI5HNE7nnaFGuUCJEDbHoeqN3pWciIjsmgP6uYUn/5rj ehzwbGwgd96B+DIzZuVO2eiR/fNsVfLH3EGEa3eZaNA78SVLVKGt5wAwNlHhPpHt IAmkmXb48eXaOttVLYnZmF8i4oZJuT75/Gdf5X++2nS212m0LOO779hdZqBlq01Y lypyxlsV1Ff8C6mzMeJGWUV3qqqUhSYo0ZwZSfY/IohDeJx9Go6lUulJB1qP8Rwn 3Cxrt9NjNDsBd+vmWCfoEDCprfhWPKjtZV8xN5ccTum4MmQhtaw+pJlx9/qUALfn Jamg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; t=1683352310; x=1683438710; bh=NFynHyiGKZDQA JtL0CirqWpcs9b5k8E5/94VkrnAK0Y=; b=gjApKP1B6PISDjnXXQ5WCHKSvLban +W5LbG1tpZqQbq78JJldOBq0cknhOglB+hm1jjg63QFVRWe+WdskGxOyeEH6S2UG cg80USiIpigwI40hAPHbIKzAzziAhfhDuNlxiHE3/+kCArDWt+lG/CJRifNdhlSp 3hzLI7guegbsmajOldcRkjUwKe5jxv3spIyDyruY8RxrnRuFCictDC/DvsGebLjh yaS4FmU8utC01B5/a/rHSUJIvFAub2zSFnJu3RRBj/vt+iNRq0zT9PTCYrVyaH1j XVh5q3GUSVt1uOgpcLDzHo6MDq0YzaiIJ7ufxys4W2DbcVIxd3b+zKQhw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrfeeffedguddtudcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhepfffhvfevuffkfhggtggujgesth dtredttddtvdenucfhrhhomhepifhrvghgucfmjfcuoehgrhgvgheskhhrohgrhhdrtgho mheqnecuggftrfgrthhtvghrnhepheegvdevvdeljeeugfdtudduhfekledtiefhveejke ejuefhtdeufefhgfehkeetnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehm rghilhhfrhhomhepghhrvghgsehkrhhorghhrdgtohhm X-ME-Proxy: Feedback-ID: i787e41f1:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 6 May 2023 01:51:48 -0400 (EDT) Date: Sat, 6 May 2023 09:58:41 +0900 From: Greg KH To: Yue Zhao Cc: stable@vger.kernel.org, linux-ext4@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, akpm@linux-foundation.org, tytso@mit.edu, adilger.kernel@dilger.ca, jack@suse.cz, yi.zhang@huawei.com, tangyeechou@gmail.com Subject: Re: [PATCH 0/1][For stable 5.4] mm: migrate: buffer_migrate_page_norefs() fallback migrate not uptodate pages Message-ID: <2023050612-thee-chafe-569c@gregkh> References: <20230503163426.5538-1-findns94@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230503163426.5538-1-findns94@gmail.com> X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Thu, May 04, 2023 at 12:34:25AM +0800, Yue Zhao wrote: > Recently we found a bug related with ext4 buffer head is fixed by > commit 0b73284c564d("ext4: ext4_read_bh_lock() should submit IO if the > buffer isn't uptodate")[1]. > > This bug is fixed on some kernel long term versions, such as 5.10 and 5.15. > However, on 5.4 stable version, we can still easily reproduce this bug by > adding some delay after buffer_migrate_lock_buffers() in __buffer_migrate_page() > and do fsstress on the ext4 filesystem. We can get some errors in dmesg like: > > EXT4-fs error (device pmem1): __ext4_find_entry:1658: inode #73193: > comm fsstress: reading directory lblock 0 > EXT4-fs error (device pmem1): __ext4_find_entry:1658: inode #75334: > comm fsstress: reading directory lblock 0 > > About how to fix this bug in 5.4 version, currently I have three ideas. > But I don't know which one is better or is there any other feasible way to > fix this bug elegantly based on the 5.4 stable branch? > > The first idea comes from this thread[2]. In __buffer_migrate_page(), > we can let it fallback to migrate_page that are not uptodate like > fallback_migrate_page(), those pages that has buffers may probably do > read operation soon. From [3], we can see this solution is not good enough > because there are other places that lock the buffer without doing IO. > I think this solution can be a candidate option to fix if we do not want to > change a lot. Also based on my test results, the ext4 filesystem remains > stable after one week stress test with this patch applied. > > The second idea is backport a series of commits from upstream, such as > > 2d069c0889ef ("ext4: use common helpers in all places reading metadata buffers") > 0b73284c564d ("ext4: ext4_read_bh_lock() should submit IO if the buffer isn't uptodate") > 79f597842069 ("fs/buffer: remove ll_rw_block() helper") Backporting the original upstream commits is almost always the correct solution. Please try doing that instead of a one-off patch like this. thanks, greg k-h