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.
Enhance reporting read-write setting
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.