sbin/hammer: Don't ioctl(SET_PFS) before attempt to destroy PFS
authorTomohiro Kusumi <kusumi.tomohiro@gmail.com>
Thu, 18 Aug 2016 14:00:44 +0000 (23:00 +0900)
committerTomohiro Kusumi <kusumi.tomohiro@gmail.com>
Sat, 20 Aug 2016 16:52:08 +0000 (01:52 +0900)
commit9376f71b677e9fcde9af7c16cd3f31cfcdb43121
tree30cff12829e6bf99fcd17b70ebe304cea40276d6
parenta003db3d5076bb648c807c1bdbaf5a77db67f8b2
sbin/hammer: Don't ioctl(SET_PFS) before attempt to destroy PFS

This is part 1/2 of what's mentioned in below post.
Two ondisk PFS data (deleted PFS followed by undeleted PFS data) will
still appear with this commit, like what's mentioned in below post.
(This comes from HAMMER's flushing mechanism, so it's basically a bad
idea to try to fix it unless it's possible without touching core part
of HAMMER's flusher code, provided that this extra ondisk PFS data
does nothing bad. This may be fixed in the future as part 2/2 patch.)

http://lists.dragonflybsd.org/pipermail/users/2016-August/313004.html

This part 1/2 patch alone is still effective even without part 2/2.

If the PFS is successfully destroyed, the ondisk PFS data written by
ioctl(HAMMERIOC_SET_PSEUDOFS) prior to destroying (which is the code
removed by this commit) gets shadowed by the one with deleted flag,
so no one is to (or no one needs to) access that.

If failed to destroy the PFS, the original ondisk PFS data is restored
using a copy of the original data, so ioctl(HAMMERIOC_SET_PSEUDOFS)
prior to destroying is still unnecessary. Also see 750beaef.
Restoring part by 750beaef could be removed too since the PFS is not
downgraded or updated anymore.
sbin/hammer/cmd_pfs.c