[ENBD] enbd-2.4.32 and Supermount

Peter T. Breuer ptb at it.uc3m.es
Tue Jan 13 04:19:25 MST 2004


"Also sprach Peter T. Breuer:"
> Can you change the "int x;" in enbd_media_changed() to
> "static int x;" (or possibly volatile :-).  That probably stops the
> pseudo-random behavior. Maybe the value of x needs inverting too.

 volatile int x;

seems to do the trick. Oww, this kind of thing makes me feel very bad.
The compiler seems not to have noticed that the address of x is passed
(indirectly) to the remote_ioctl call, and x is tested afterwards. It
seems to have optimised the result value of x supposing that the call 
will not affect it. My guess.

Now one only has to worry about the return value. The remote end returns
0 to mean OK. But we seem to clear the validated flag whenn we get
that, which had bad results for you. I think one wants to change the

  if (x)

to

  if (!x)

in the  enbd_media_changed() routine. And maybe we want to return x
and not !x. I'll look in the kernel for an answer when I've had breakfast.

Peter


More information about the ENBD mailing list