Re: [PATCH 0/3] fs: return ERR_PTR() from iget_locked() and friends

From: Jan Harkes

Date: Tue Dec 01 2026 - 11:09:43 EST


On Tue, Dec 01, 2026 at 04:34:50PM +0300, Konstantin Adzer wrote:
> iget_locked(), iget5_locked(), iget5_locked_rcu() and inode_insert5()
> return NULL for a failed allocation and also for an inode under
> creation, which find_inode() and find_inode_fast() report as -ESTALE.
> Callers read NULL as -ENOMEM. As reported in [1], open_by_handle_at() on
> ext4 then fails with ENOMEM, and nfsd returns a jukebox/DELAY error, for
> the handle of a deleted inode whose number is being reused. Following
> the discussion in [2], this series makes the helpers return ERR_PTR().
>
> Patches 1 and 2 make fuse_iget() and hfs_iget() return ERR_PTR(), so
> that patch 3 can convert the four helpers and all their callers at once.

(I had to remove a bunch of addresses from the CC list because Google
was not allowing me to send my response to 'too many recipients'. sorry
to anyone who got excluded)

I don't like this change because this is an API used by external file
system modules and they are expecting a NULL instead of an ERR_PTR.

Jan