bsdperimeter/pfsense — pull request #250 by phil-davis (2012-11-15 04:04:41+00:00)
Title: Enhance reporting and changing read-write setting on nanoBSD

If the user has already selected Current Read/Write Status to be Read-Write, then they also choose Permanent Read/Write the mount refcount becomes 2. Then if they turn off Permanent Read/Write the setting is saved, but the refcount goes back to 1. This results in the file system still being mounted Read-Write.
This would be unexpected behaviour IMO - a user who came back some days later to turn off Permanent Read-Write would expect the file system to switch back to Read-Only in real time, as well as changing back the config setting.
This corrects the above behaviour.
I also added display of the refcount if it is more than 1. If for some reason multiple other things leave the file system mounted then this can be immediately seen on the GUI.
Note: The "Switch to Read-Only" button only decrements the refcount by 1 each time. So if the refcount is >1 the user has to press a few times to get the count back to zero and the file system read-only. I think this is reasonable behaviour.
The refcount display can be tested simply by running /etc/rc.conf_mount_rw a few times from a command shell, then looking at the Diagnostics-NanoBSD GUI.