Re: 2.1.118 Tons of oopes

Jamie Lokier (lkd@tantalophile.demon.co.uk)
Sat, 29 Aug 1998 15:41:45 +0100


Doug Ledford wrote:
> Linus adds flush() to the struct. He puts it at the end, only the NFS code
> uses it, every one else uses auto initing of their struct.
>
> Later he adds another new option to the end that not all fses need.
> However, you decide you need it in your code. You add the initializer to
> the end of your struct, but you forget that the flush item was never added,
> so all of a sudden you now have a flush entry that does something totally
> different and many people totally screw their filesystems thanks to you.

A very good point, well made.

As you'll know, this can only happen if the function types are the same
towards the end of the ops structure. Which is, of course, rather
likely.

My point is the Linus approach with flush, while a fine one, relies on
the types later in the structure being different enough to cause
non-updated drivers to fail to compile. This could be a matter of luck
or guile, who knows how Linus' mind works ;-)

If the types were the same after inserting a new op, older drivers would
compile just fine and people would screw up their filesystems.

So inserting in the middle of the structure does not guarantee
everything will be fine. But by luck or guile, it does in this case.

-- Jamie

-
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.altern.org/andrebalsa/doc/lkml-faq.html