If /var is a tmpfs, using a simple "freebsd-update -r X.Y upgrade" will fails. It will correctly fetch and install the kernel, then ask for reboot and entering "freebsd-update install", but after the reboot, the "freebsd-update install" will say "No updates are available to install" and stuck user with a new kernel but old userland. => There should have a check to be added for checking if the temporary directory used by freebsd-update is on a RAM disk (tmpfs, md, etc…)
I put up an attempt at solving this, but have no idea if anyone really wants to attempt this protection: https://reviews.freebsd.org/D1163
A commit references this bug: Author: feld Date: Mon Nov 17 15:12:47 UTC 2014 New revision: 274630 URL: https://svnweb.freebsd.org/changeset/base/274630 Log: Add logic for detecting non-persistent filesystems being utilized by workdir which would break the upgrade process upon reboot. Currently we check for tmpfs and mdmfs. PR: 195006 Differential Revision: https://reviews.freebsd.org/D1163 Approved by: cperciva Changes: head/usr.sbin/freebsd-update/freebsd-update.sh