Messages in this thread | | | Date | Wed, 16 Feb 2000 21:45:18 +0000 (GMT) | From | Riley Williams <> | Subject | Re: Of removable devices |
| |
Hi Khimenko.
===8<=== Comments cut for brevity ===>8===
> This is all doable as I said from the very beginning but it'll > require DEEP rework of VFS, not just small changes. It IS > usefull (for example for discussed here situation where you have > big disk with rarely used stuff and want to not re-fsck it after > crash if in fact disk was not used) but it's also HARD work if > you want to do it right.
One thought that might help with that, although I haven't the experience to implement it: At the moment, there's (presumably) a single flag somewhere in the kernel that states that a particular partition is mounted either RO or RW.
Why not split this into two flags, one stating the desired mount state of the partition (I'll call this MOUNT_RO herein), and a second stating the current state of the partition (I'll call this CURRENT_RO herein).
The following logic should then be possible:
1. If MOUNT_RO is TRUE then CURRENT_RO is also true.
2. When a partition is first mounted RW, MOUNT_RO is set FALSE but CURRENT_RO is set true and the partition is set up as if it had been mounted RO instead.
The same would apply when `mount -o remount,rw` is applied to a partition that is currently mounted RO.
3. When MOUNT_RO is FALSE and CURRENT_RO is TRUE and something happens to cause the kernel to want to write to it, the kernel first sets up the partition as a RW one, then sets CURRENT_RO to FALSE, and only then starts writing.
4. When MOUNT_RO and CURRENT_RO are both FALSE but the kernel has written out everything it needs to AND a specified timeout has elapsed since it last had anything to write out, it first sets up the partition as if it was mounted RO, then sets CURRENT_RO to TRUE.
5. When a partition is unmounted, if CURRENT_RO is FALSE, the kernel blocks until CURRENT_RO is TRUE, then proceeds to unmount the partition as requested.
As I see it, that would basically deal with the situation you refer to, and would mean that a crash or powercut would only leave marked as dirty those partitions that could actually be dirty.
Before anybody asks, the names used herein are only for the purpose of this discussion, and should not be taken as being requirements as to the names to be used if this is implemented.
Comments, anybody?
Best wishes from Riley.
* Copyright (C) 1999, Memory Alpha Systems. * All rights and wrongs reserved.
+----------------------------------------------------------------------+ | There is something frustrating about the quality and speed of Linux | | development, ie., the quality is too high and the speed is too high, | | in other words, I can implement this XXXX feature, but I bet someone | | else has already done so and is just about to release their patch. | +----------------------------------------------------------------------+ * http://www.memalpha.cx/Linux/Kernel/
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/
| |