We should fix the flaw in load_sb, instead of going to global variables
which would all have to be undone if we move the server to kernel.
I will provide a fix and test it.
Regards,
Daniel
OK, I'm staying with my "don't hack it, fix it" stance on this one.
When I looked at the code in question I found the entire load_sb
function was bogus, called in only one place, and zeroing variables
it should not be zeroing (they are already zeroed in new_sb).
I moved the load_sb code into the START_SERVER case in the main
loop, where some related code already existed.
There are actually two flags fields in the superblock, one for
the image (64 bits) and one for runtime. This is intensely
confusing and in fact I found a bug there: the SB_DIRTY flag was
stored on disk, which clearly makes no sense. So I renamed the
flags field that is not stored on disk as "runflags" to clarify
things. I removed SB_DIRTY from the sbflags enumeration, and
created a new enumeration for runtime flags not stored on disk.
I changed SB_DIRTY to RUN_SB_DIRTY to clarify the distinction
(probably getting a bit verbose there but oh well, the bug I just
noticed won't happen again).
I was also erroneously storing the SB_DEFER flag in the disk
superblock, which is actually what caused the bug you saw, not the
erroneous initialization in load_sb. Gah! The things you find
when you read mature code closely.
May I get up on a pulpit for a moment? It is nearly always better
to do a proper fix than a quick hack just to make something work.
In this case I found that the apparent bug was not the real bug.
It often takes a little longer to do a proper fix but it is said
that in the long run, it actually saves time.
Not tested! I will ping the list when it is tested.
Daniel
I'm slowing everybody down by not checking in this patch. Let's just
do it side by side today, ok? Here is the latest version posted to our
list. See you later.
Daniel