https://bugzilla.novell.com/show_bug.cgi?id=427330
Summary: Write error before starting nfsserver-service, when
started the service that is already running
Product: openSUSE 11.1
Version: Alpha 0
Platform: PowerPC-64
OS/Version: All
Status: NEW
Severity: Normal
Priority: P5 - None
Component: Installation
AssignedTo: bnc-team-screening@forge.provo.novell.com
ReportedBy: bugproxy@us.ibm.com
QAContact: jsrain@novell.com
Found By: Third Party Developer/Partner
Partner ID: LTC 45004
=Comment: #0=================================================
Indhu Durai - 2008-05-22 06:25 EDT
Problem description:
====================
When i start the service nfsserver when the service is already running, i am
facing following error,
linux:~ # service nfsserver restart
Shutting down kernel based NFS server: nfsd statd mountd done
Starting kernel based NFS server: idmapd mountd statd nfsd sm-notify done
linux:~ # service nfsserver start
------------------------------- error
------------------------------------------
Starting kernel based NFS server:/etc/init.d/nfsserver: line 170: echo: write
error: Device or resource busy
--------------------------------------------------------------------------------
idmapd mountd statd nfsd sm-notify done
linux:~ #
--------------------------------------------------------------------------------
Machine information:
====================
uname -a:
Linux linux 2.6.25.3-2-ppc64 #1 SMP 2008-05-10 07:46:36 +0200 ppc64 ppc64 ppc64
GNU/Linux
Hardware Environment
Machine type (p650, x235, SF2, etc.): P510
Cpu type (Power4, Power5, IA-64, etc.):Power5
--------------------------------------------------------------------------------
Reproduce the issue:
====================
-> Start the nfsserver service
-> Start the service again, when nfsserver is running.
=Comment: #1=================================================
Suzuki Kp - 2008-05-29 06:44 EDT
The error is coming from the kernel :
static ssize_t write_versions(struct file *file, char *buf, size_t size)
{
/*
* Format:
* [-/+]vers [-/+]vers ...
*/
char *mesg = buf;
char *vers, sign;
int len, num;
ssize_t tlen = 0;
char *sep;
if (size>0) {
if (nfsd_serv)
/* Cannot change versions without updating
* nfsd_serv->sv_xdrsize, and reallocing
* rq_argp and rq_resp
*/
return -EBUSY; <<-- We get EBUSY here.
nfsd_serv structure gets initialized when the nfs server starts. So when we try
to start the nfs server again, it tries to write to the /proc/fs/nfsd/versions
file. The write_versions() listed above checks whether the nfsd_serv is already
initialized,(which is true for our case) and hence fails the write. Comment
explains why this is done.
Thanks
Suzuki
=Comment: #2=================================================
Suzuki Kp - 2008-06-09 11:01 EDT
I looked at this issue and I don't really see a problem with this. In the
sense,
the error can just be ignored as it is supposed to fail, if you write twice to
the /proc/fs/nfsd/versions file.
Any thoughts / comments ?
Thanks
Suzuki
=Comment: #3=================================================
Mohammed Omar - 2008-06-10 03:30 EDT
Indhu/Suzuki,
I agree , its an expected behavior.
And I think /etc/init.d/nfsserver would have reported "service is already
running" instead of "write error".
For Example , If you try to start a service which is already running it behaves
in different way...
sshd daemon:
============
linux:~ # /etc/init.d/sshd status
Checking for service sshd running
linux:~ # /etc/init.d/sshd start
Starting SSH daemon done
smb daemon:
===========
linux:~ # /etc/init.d/smb status
Checking for Samba SMB daemon running
linux:~ # /etc/init.d/smb start
Starting Samba SMB daemon - Warning: daemon already running. done
--Regards.. Omar M
=Comment: #4=================================================
Suzuki Kp - 2008-06-12 06:25 EDT
(In reply to comment #3)
Indhu/Suzuki,
I agree , its an expected behavior.
And I think /etc/init.d/nfsserver would have reported "service is already
running" instead of "write error".
The reason why the nfsserver doesn't do it here is because :
There are 4 daemons associated with the nfsserver. nfsd, idmapd,mountd,statd .
We have to check for each and every daemon before we say that nfsd is already
up
and running. May be we don't want to delay the services just to take care of
this silly situation.
Also, this messages is generated when we try to update the
/proc/fs/nfsd/versions file and not while starting the daemon.
Thanks
Suzuki
=Comment: #5=================================================
Suzuki Kp - 2008-06-17 03:11 EDT
Test patch
Hi Indhu,
Attached here is a patch which adds the check for whether the nfsserver is
already running and exits if it is already up and running.
Thanks
Suzuki
=Comment: #6=================================================
Indhu Durai - 2008-07-11 02:37 EDT
Hi Suzuki,
Issue resolved.
Thanks,
Indhu Durai
=Comment: #8=================================================
Cijurajan Kollanoor - 2008-09-02 08:21 EDT
Please test this patch. It is a simple patch that will write to the file
/proc/fs/nfsd/exports only if nfsserver is not started.
=Comment: #9=================================================
Cijurajan Kollanoor - 2008-09-02 08:23 EDT
patch to suppress the error message
=Comment: #10=================================================
Pavan Naregundi - 2008-09-17 02:30 EDT
(In reply to comment #8)
I have tested this patch. Patch looks OK.
--
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.