[Nbd] [RFC]Some questions about NBD
Hi Wouter,
I have some questions to ask you, which are like following.
1, Pavel said "Unlike NFS, it is possible to put any file system on it. But
(also unlike NFS), if someone has mounted NBD read/write, you must
assure that no one else will have it mounted. " on his own page. The
URL is http://atrey.karlin.mff.cuni.cz/~pavel/nbd/nbd.html . But i can not
understand '' if someone has mounted NBD read/write, you must
assure that no one else will have it mounted.". What is exact meaning of
this sentence.
One of my thoughts looks like this. We have two users, a1
and a2 , who
have logined into a Linux OS. If a1 mounted NBD read/write, a2 must not
mount it currently, right?
2, I have seen the main function of nbd-server.c, which version is nbd-2.9.15.
Some stuffs confuse me like following.
1> 1882 line: memset(pidftemplate, '\0', 256);
I just see pidftemplate is used in the daemon function.
But i am not
sure what the pid file is used for. And also i don't know the meaning of
this daemon function in nbd-server.c.
2> 1873: SERVER *server;
If we have (server != NULL && (0 == server->port)) we will
execute inetd
mode. I have searched the characters of inetd but i am not sure what the
meanings of inetd in our nbd-server.c do. And in what
situations, we will do
the inetd mode, which should do what jobs?
3> 1928: dousers();
I just tracked this function. It looks like it will set
the running group and
user informations. Why should we do this? Is it related to what
pavel said
"if someone has mounted NBD read/write, you must assure that no one else
will have it mounted". Right ?
This time, i just ask these questions. If i have other ones, i will
send to you ;D
Thanks very much, Wouter.
--
Thanks
Harry Wei
Reply to: