remount a partition to change access permission
I have a partition mounted as read only in my embedded linux machine for safety reason. At some point, I want to write something to it, then I use this command to change the permission (and change back to read only afterward):
However, there is one thread which is using files in this partition (with mmap function). When this command is executed, the thread will be suspended for a short time, I think because remount option detaches and attaches the partition, hence the thread cannot find it and get suspended.
mount -o remount,rw path-to-partition
Is there more efficient way to change partition access permission?