Validate mountpoint on path-based unmount using statx

Use statx to verify that path-based unmounts proceed only if the
mountpoint reported by statx matches the MNTTAB entry reported by
libzfs, aborting the operation if they differ. Align
`zfs umount /path` behavior with `zfs umount dataset`.

Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Signed-off-by: Ameer Hamza <ahamza@ixsystems.com>
Closes #17481
This commit is contained in:
Ameer Hamza
2025-07-09 07:10:00 +05:00
committed by Tony Hutter
parent a7d6dff421
commit a5ba57ad82
5 changed files with 89 additions and 6 deletions
+5
View File
@@ -30,6 +30,11 @@
#include <sys/mount.h> /* for BLKGETSIZE64 */
#ifdef HAVE_STATX
#include <fcntl.h>
#include <linux/stat.h>
#endif
/*
* Emulate Solaris' behavior of returning the block device size in fstat64().
*/