]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Linux: always check or verify return of igrab()
authorAdam D. Moss <c@yotes.com>
Tue, 16 Mar 2021 23:33:34 +0000 (16:33 -0700)
committerGitHub <noreply@github.com>
Tue, 16 Mar 2021 23:33:34 +0000 (16:33 -0700)
commit1daad98176d18a785d116d9666dadc866f631f98
treead4a4bb806f02a98f3ceb3f6f7ada1639620689e
parent5f9d61d06b5a2df87d8d5733429cf4eba66f0acb
Linux: always check or verify return of igrab()

zhold() wraps igrab() on Linux, and igrab() may fail when the inode
is in the process of being deleted.  This means zhold() must only be
called when a reference exists and therefore it cannot be deleted.
This is the case for all existing consumers so add a VERIFY and a
comment explaining this requirement.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Adam Moss <c@yotes.com>
Closes #11704
include/os/linux/zfs/sys/zfs_znode_impl.h
module/os/linux/zfs/zfs_ctldir.c
module/os/linux/zfs/zfs_vfsops.c
module/os/linux/zfs/zpl_inode.c