[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20260127063809.GB25894@lst.de>
Date: Tue, 27 Jan 2026 07:38:09 +0100
From: Christoph Hellwig <hch@....de>
To: "Darrick J. Wong" <djwong@...nel.org>
Cc: Eric Biggers <ebiggers@...nel.org>, Christoph Hellwig <hch@....de>,
Al Viro <viro@...iv.linux.org.uk>,
Christian Brauner <brauner@...nel.org>, Jan Kara <jack@...e.cz>,
David Sterba <dsterba@...e.com>, Theodore Ts'o <tytso@....edu>,
Jaegeuk Kim <jaegeuk@...nel.org>, Chao Yu <chao@...nel.org>,
Andrey Albershteyn <aalbersh@...hat.com>,
Matthew Wilcox <willy@...radead.org>, linux-fsdevel@...r.kernel.org,
linux-btrfs@...r.kernel.org, linux-ext4@...r.kernel.org,
linux-f2fs-devel@...ts.sourceforge.net, fsverity@...ts.linux.dev
Subject: Re: [PATCH 07/16] fsverity: don't issue readahead for non-ENOENT
errors from __filemap_get_folio
On Mon, Jan 26, 2026 at 10:28:49PM -0800, Darrick J. Wong wrote:
> > Yes, it's really just a cast, and 'PTR_ERR(folio) == -ENOENT' actually
> > still works when folio isn't necessarily an error pointer. But normally
> > it would be written as a pointer comparison as I suggested.
>
> How does one know that a pointer is an error pointer? Oughtn't there be
> some kind of obvious marker, or is IS_ERR the only tool we've got?
IS_ERR(ptr) is the interface to check is a pointer is an error pointer
or not.
PTR_ERR(ptr) == -EFOO checks if ptr is an error pointer for the errno
value -EFOO.
Powered by blists - more mailing lists