Sfoglia il codice sorgente

[PATCH] knfsd: Protect update to sn_nrthreads with lock_kernel

Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
NeilBrown 19 anni fa
parent
commit
cda9e0cd8a
1 ha cambiato i file con 2 aggiunte e 0 eliminazioni
  1. 2 0
      fs/nfsd/nfsctl.c

+ 2 - 0
fs/nfsd/nfsctl.c

@@ -532,7 +532,9 @@ static ssize_t write_ports(struct file *file, char *buf, size_t size)
 			/* Decrease the count, but don't shutdown the
 			 * the service
 			 */
+			lock_kernel();
 			nfsd_serv->sv_nrthreads--;
+			unlock_kernel();
 		}
 		return err;
 	}