[ENBD] Re: problems with floppy
P.T. Breuer
ptb at it.uc3m.es
Sun Dec 21 06:20:20 MST 2003
In article <200312180100.32400.patryk at moveo.pl> you wrote:
> But I forgot to admit, that apart from all, I cannot mount floppy on client.
One thing that is not clear from your account is if you loaded the
enbd_ioctl.o module, which does the remote ioctls needed to manage
floppies - umm, well, maybe.
> (I tried with some harddisk and everything was fine), but now, when I do:
> #mount -t msdos /dev/nda /mnt/remote
> Error appears:
> mount: wrong fs type, bad option, bad superblock on /dev/nda,
> or too many mounted file systems
> and neither server nor client logs anything
I'm actually scanning through the floppy ioctls now to see if there is
anything that can be used to detect the floppy instead of an open/close
sequence. They're largely incomprehensible! :-). Oh ... maybe
FDPOLLDRVSTAT? Int's anyones guess even what parameters it takes!
case FDPOLLDRVSTAT:
LOCK_FDC(drive,1);
CALL(poll_drive(1, FD_RAW_NEED_DISK));
process_fd_request();
/* fall through */
OUT(FDGETDRVSTAT, UDRS);
OUT is #define OUT(c,x) case c: outparam = (const char *) (x); break,
so I would guess that something is set to UDRS whatever the result of
the call to poss_drive, and UDRS is #define UDRS (&drive_state[drive])
.... gaaaah. This is incomprehensible. No two ways about it.
Maybe use instead
/*
* Check if the disk has been changed or if a change has been faked.
*/
static int check_floppy_change(kdev_t dev)
which appears to be in the block device ops table as "check_media_change".
But I don't know anybody but the kernel who calls that. It's called by
check_disk_change in block_dev.c.
/*
* This routine checks whether a removable media has been changed,
* and invalidates all buffer-cache-entries in that case. This
* is a relatively slow routine, so we have to try to minimize using
* it. Thus it is called only upon a 'mount' or ópen'. This
* is the best way of combining speed and utility, I think.
* People changing diskettes in the middle of an operation deserve
* to lose :-)
*/
int check_disk_change(kdev_t dev)
and there we are - precisely the reason why the enbd-server spends its
spare time doing opens and closes of the floppy device, when it is
serving it.
Amazingly, check_disk_change is called by the floppy routines in
floppy_open and invalidate_drive. Doesn't it know whether it has a disk
in its own drive or not? This is a mess. Layering violation, surely!
However ... invalidate_drive is triggered by the FDCLRPRM ioctl. And by
the FDFLUSH ioctl. Maybe FDFLUSH is good enough, but it will have the
same effect as opening and closing, surely?
Nope - I see no obvious way of testing for a floppy disk change without
somehow causing the floppy drive to be accessed.
I suspect that the real answer is to pass on the news of an open or a
mount on the client (which will trigger the enbd drivers check media
routine) across to the server. I can do that.
For the moment, the floppy drive is polled for its status.
Peter
More information about the ENBD
mailing list