Skip to content

Commit

Permalink
Be better at making sure vfs_iterate() is ZFS
Browse files Browse the repository at this point in the history
Poking into the "mp/vfsprivate" pointer is risky.
  • Loading branch information
lundman committed Jul 3, 2022
1 parent 4bab755 commit 02df131
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions module/os/macos/zfs/zfs_vnops_osx.c
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,12 @@ zfs_findernotify_callback(mount_t mp, __unused void *arg)

zfsvfs = vfs_fsprivate(mp);

/* As set in vfs_fsadd() below */
char tname[MFSNAMELEN] = { 0 };
vfs_name(mp, tname);
if (strncmp(tname, "zfs", MFSNAMELEN) != 0)
return (VFS_RETURNED);

/*
* The first entry in struct zfsvfs is the vfs ptr, so they
* should be equal if it is ZFS
Expand Down

0 comments on commit 02df131

Please sign in to comment.