From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 123E92F38 for ; Mon, 30 May 2022 13:53:30 +0000 (UTC) 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> Precedence: bulk X-Mailing-List: ntfs3@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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)