[ENBD] enbd-2.4.32 and Supermount

Peter T. Breuer ptb at it.uc3m.es
Tue Jan 13 08:24:00 MST 2004


"Also sprach Peter T. Breuer:"
> 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.

Yes - looking at the kernel code, it wants a 0 return from the
check_media routine to signal success (and not do an invalidate
buffers). So the enbd_media_changed() routine should terminate like
this:

        // PTB remote ioctl returns 0 for success and we read the result
        if (!x)
                atomic_set_mask (ENBD_VALIDATED, &lo->flags);
        else
                atomic_clear_mask (ENBD_VALIDATED, &lo->flags);
        return x;

as we also get x=0 from the remote ioctl for success.

It seems, though I wouldn't swear to it (TM), that the x must be from
the heap, not the stack, so it has to be static or kmalloc'ed. Sigh -
I'll kmalloc it. 

Peter


More information about the ENBD mailing list