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 EA673C77B7F for ; Wed, 3 May 2023 15:49:40 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 495BB6B0083; Wed, 3 May 2023 11:49:40 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 41C896B0085; Wed, 3 May 2023 11:49:40 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 331116B0087; Wed, 3 May 2023 11:49:40 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by kanga.kvack.org (Postfix) with ESMTP id 0D9136B0083 for ; Wed, 3 May 2023 11:49:40 -0400 (EDT) Received: by verein.lst.de (Postfix, from userid 2407) id 30FC668AA6; Wed, 3 May 2023 17:49:36 +0200 (CEST) Date: Wed, 3 May 2023 17:49:36 +0200 From: Christoph Hellwig To: Matthew Wilcox Cc: Christoph Hellwig , akpm@linux-foundation.org, jack@suse.cz, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, dhowells@redhat.com, marc.dionne@auristor.com, linux-afs@lists.infradead.org, syzbot+48011b86c8ea329af1b9@syzkaller.appspotmail.com Subject: Re: [PATCH 1/2] filemap: fix the conditional folio_put in filemap_fault Message-ID: <20230503154936.GA31522@lst.de> References: <20230503154526.1223095-1-hch@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) 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 Wed, May 03, 2023 at 04:48:20PM +0100, Matthew Wilcox wrote: > > - folio_put(folio); > > Why not simply: > > - if (folio) > + if (!IS_ERR_OR_NULL(folio)) no need for the OR_NULL. But I find the extra label way easier to reason about, and it's exactly the same amount of code.