[ENBD] How do I *stop* serving a floppy?

Peter Billson enbd@lists.community.tummy.com
Wed, 21 May 2003 12:23:33 -0400


Peter & Mark,
  I must thank you both for your excellent (and very fast) help on this.
I need to do some more extensive testing to make sure the set up works
reliably but what I have so far is:

1) Leave the client/server as synchronous

2) Comment out the sync loop code at the bottom of enbd-server.c.
(Perhaps this could be a command-line option?)

3) Set the pulse time of the client to 60 seconds (-p 60). This isn't
really necessary, but I'm thinking it will be a lot kinder to the floppy
drive to start and stop the motor 60 times an hour instead of 600!


 I am using automounter on the client with a very short (1 second) time
out so I really do not need enbd worrying about changed media. Since
umount flushes the buffers and enbd is synchronous, the floppy is always
within 1 second of being current. I see three scenarios:

1) The floppy is unmounted by the client: The user can shuffle through
all the floppies they want. I don't care.

2) The floppy is mounted by the client: This only occurs during floppy
access and for one second afterwards. If a user changes media here they
are pretty much screwed even if enbd knows about the media change. Also,
it is pretty intuitive not to eject your floppy while the drive light is
on and most floppy drives run for a second or two after the system is
done with them.

3) The floppy isn't there but the client tries to access it anyway. This
is the one I need to test the hell out of because there are so many ways
this can happen. A user could easily try to access a nonexistent floppy,
realize their mistake, pop in a floppy and try to access again in a few
seconds... or put in the wrong disk, change it, etc.


"Peter T. Breuer" wrote:
> 
> "A month of sundays ago Travis, Mark wrote:"
> > In enbd-server.c there's a line that says:
> >       // is floppy, make us sync
> >
> > Comment out the next 2 lines and rebuild to see what it does...
> 
> Yes, that's OK, but all that does is set the sync flag if the async
> flag was not already set. Setting the async flag (by -a ?) will have
> the same effect.
> 
>     if (S_ISBLK (buf.st_mode) && MAJOR (buf.st_rdev) == 2
>         && !(*flags & F_ASYNC)) {
>         // is floppy, make us sync
>         *flags |= F_SYNC;
>         MSG ("set sync flags on %s because it's a floppy\n", exportname);
>     }
> 
> (from file.c).
> 
> The open, sync, close loop is in the main server, and the async flag
> only stops the sync:
> 
>          if (file->open(file) >= 0) {
>               if (!(self->flags * F_ASYNC))
>                   file->sync(file);
>               file->close(file);
>           }
> 
> So that leaves the open and close. One can comment them out too.
> Warning, that makes the kernel less aware that media have changed.
> 
> When the clients are connected, there will still be seek commands sent
> every 5s or so to make sure the medium still is there.
> 
> Peter
> _______________________________________________
> ENBD mailing list
> ENBD@lists.community.tummy.com
> http://lists.community.tummy.com/mailman/listinfo/enbd

-- 
http://www.elbnet.com
ELB Internet Service, Inc.
Web Design, Computer Consulting, Internet Hosting