patch-2.1.72 linux/fs/nfsd/lockd.c

Next file: linux/fs/nfsd/vfs.c
Previous file: linux/fs/nfs/dir.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.71/linux/fs/nfsd/lockd.c linux/fs/nfsd/lockd.c
@@ -16,6 +16,9 @@
 
 #define NFSDDBG_FACILITY		NFSDDBG_LOCKD
 
+/*
+ * Note: we hold the dentry use count while the file is open.
+ */
 static u32
 nlm_fopen(struct svc_rqst *rqstp, struct knfs_fh *f, struct file *filp)
 {
@@ -27,6 +30,8 @@
 	fh.fh_dverified = 0;
 
 	nfserr = nfsd_open(rqstp, &fh, S_IFREG, 0, filp);
+	if (!nfserr)
+		dget(filp->f_dentry);
 	fh_put(&fh);
 	return nfserr;
 }
@@ -35,6 +40,7 @@
 nlm_fclose(struct file *filp)
 {
 	nfsd_close(filp);
+	dput(filp->f_dentry);
 }
 
 struct nlmsvc_binding		nfsd_nlm_ops = {

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov