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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 021C8C4332F for ; Mon, 30 May 2022 14:38:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238481AbiE3Oi1 (ORCPT ); Mon, 30 May 2022 10:38:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38150 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241437AbiE3OdL (ORCPT ); Mon, 30 May 2022 10:33:11 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C28E3136423 for ; Mon, 30 May 2022 06:53:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=OiY2rgRVZOqCidaxajNJLm4/9jAUCwIR4FPAxWy2Dkw=; b=CKyErjZFlP08nqv37BWO212Qxe PVg5/e1gISSY/X/5qshOtglb7m0BTOFeaZBjS+jiMuCYJ+umqqv0nGbwt1i+IeQI4V+l+RHWgdlz4 AwAeA5R8VOy/kG6mVS9fpVGuapZVWvvUAcUOWBEBYdOjusfyA7bSOmErRoejdBu5u6qGg3jF5qLGl v3Z0nnygaaGS14GAZDFbUXM9ygDOjq1n+ThDO/9TS13H+UYOmgkS3AWzcir7oV4YRZk51X3ZSE27y /5ZnWLvUPY9KAq5L0N0R4b3pKfmIJCRUEvSmrvmCJn5lcqUaC36rmdlfuAcTDZgmwgZ3QlAj/CuIT ggo0H0AQ==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nvfpj-004WKH-M8; Mon, 30 May 2022 13:53:23 +0000 Date: Mon, 30 May 2022 14:53:23 +0100 From: Matthew Wilcox To: Mikulas Patocka Cc: manualinux@yahoo.es, Konstantin Komarov , Alexander Viro , ntfs3@lists.linux.dev, linux-fsdevel@vger.kernel.org Subject: Re: [PATCH] ntfs3: provide block_invalidate_folio to fix memory leak Message-ID: References: <20220524113314.71fe17f0@yahoo.es> <20220525130538.38fd3d35@yahoo.es> <20220527072629.332b078d@yahoo.es> <20220527080211.15d631be@yahoo.es> <20220528061836.22230f86@yahoo.es> <20220530131524.7fb5640d@yahoo.es> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On Mon, May 30, 2022 at 08:57:15AM -0400, Mikulas Patocka wrote: > In the kernel 5.17 and before, if the "invalidatepage" method is NULL, the > kernel will use block_invalidatepage (see do_invalidatepage). So, we don't > have to provide explicit "invalidatepage" in 5.17 and before and we don't > have to backport this bugfix there. > > Note that the commit 7ba13abbd31e contains this piece of code: > -#ifdef CONFIG_BLOCK > - if (!invalidatepage) > - invalidatepage = block_invalidatepage; > -#endif > > So, it explicitly breaks filesystems that have NULL invalidatepage and > NULL invalidate_folio and that relied on block_invalidatepage being called > implicitly. So, I believe this commit is the root cause of this bug. Oh, right, I missed ntfs3 in that commit. Oops. Acked-by: Matthew Wilcox (Oracle)