Re: don't take nfsd_mutex twice when setting number of threads

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jun 18, 2009 at 12:41:37PM -0400, bfields wrote:
> I'm applying the following patch for 2.6.31.

And this.

commit 671e1fcf63fd115eabcb693b06cbc2e4a3d1a3a3
Author: NeilBrown <neilb@xxxxxxx>
Date:   Tue Jun 16 11:03:20 2009 +1000

    nfsd: optimise the starting of zero threads when none are running.
    
    Currently, if we ask to set then number of nfsd threads to zero when
    there are none running, we set up all the sockets and register the
    service, and then tear it all down again.
    This is pointless.
    
    So detect that case and exit promptly.
    (also remove an assignment to 'error' which was never used.
    
    Signed-off-by: NeilBrown <neilb@xxxxxxx>
    Acked-by: Jeff Layton <jlayton@xxxxxxxxxx>

diff --git a/fs/nfsd/nfssvc.c b/fs/nfsd/nfssvc.c
index 209eaa0..d4c9884 100644
--- a/fs/nfsd/nfssvc.c
+++ b/fs/nfsd/nfssvc.c
@@ -390,12 +390,14 @@ nfsd_svc(unsigned short port, int nrservs)
 
 	mutex_lock(&nfsd_mutex);
 	dprintk("nfsd: creating service\n");
-	error = -EINVAL;
 	if (nrservs <= 0)
 		nrservs = 0;
 	if (nrservs > NFSD_MAXSERVS)
 		nrservs = NFSD_MAXSERVS;
-	
+	error = 0;
+	if (nrservs == 0 && nfsd_serv == NULL)
+		goto out;
+
 	/* Readahead param cache - will no-op if it already exists */
 	error =	nfsd_racache_init(2*nrservs);
 	if (error<0)
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux