sys/vfs/hammer: Don't let ioctl(HAMMERIOC_SET_PSEUDOFS) create PFS in PFS
commit283f6970e848724e9bd2c20d5311e412dea5e67c
authorTomohiro Kusumi <kusumi.tomohiro@gmail.com>
Sun, 13 Dec 2015 10:49:30 +0000 (13 19:49 +0900)
committerTomohiro Kusumi <kusumi.tomohiro@gmail.com>
Sun, 13 Dec 2015 13:52:04 +0000 (13 22:52 +0900)
treedab91a17dc6e5428bd182662da5796d2e0c80d3d
parent4daef0dd1dceadb61e85f04b633f9a13977cc34a
sys/vfs/hammer: Don't let ioctl(HAMMERIOC_SET_PSEUDOFS) create PFS in PFS

hammer pfs-master|slave have been preventing users from creating
a PFS in non-root PFS, but since kernel HAMMER code also assumes
the parent inode of (non-root)PFS root inode has 0 for ip localization,
ioctl(HAMMERIOC_SET_PSEUDOFS) itself should avoid that too.

This commit doesn't affect HAMMER userspace commands because
hammer pfs-master|slave prevent creating a PFS in PFS prior to
calling ioctl(HAMMERIOC_SET_PSEUDOFS). It just makes better sense
to have this check in kernel space as well since one could write
its own userspace program that directly calls ioctl without using
hammer userspace code.

Also see 5b4785a6.
sys/vfs/hammer/hammer_pfs.c