public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [NFS] [PATCH] Corrects error patch in nfs_instantiate()
@ 2003-04-04 17:01 Steve Dickson
  0 siblings, 0 replies; only message in thread
From: Steve Dickson @ 2003-04-04 17:01 UTC (permalink / raw)
  To: nfs-request; +Cc: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 288 bytes --]

In the 2.4.20 kernel, nfs_instantiate() is only calling d_drop() when
the lookup fails. The dentry also need to be removed from the
dirent cache when we can't get an inode.... Also, as Trond
pointed out, ENOMEM should be returned (instead of EACCES)
when we run out of inodes...

SteveD.

[-- Attachment #2: linux-2.4.20-nfs-d_drop.patch --]
[-- Type: text/plain, Size: 676 bytes --]

--- linux-2.4.20/fs/nfs/dir.c.orig	2003-04-04 06:55:20.000000000 -0500
+++ linux-2.4.20/fs/nfs/dir.c	2003-04-04 08:40:53.000000000 -0500
@@ -756,7 +756,7 @@ static int nfs_instantiate(struct dentry
 				struct nfs_fattr *fattr)
 {
 	struct inode *inode;
-	int error = -EACCES;
+	int error = 0;
 
 	if (fhandle->size == 0 || !(fattr->valid & NFS_ATTR_FATTR)) {
 		struct inode *dir = dentry->d_parent->d_inode;
@@ -768,9 +768,12 @@ static int nfs_instantiate(struct dentry
 	if (inode) {
 		d_instantiate(dentry, inode);
 		nfs_renew_times(dentry);
-		error = 0;
+	} else {
+		error = -ENOMEM;
+		goto out_err;
 	}
 	return error;
+
 out_err:
 	d_drop(dentry);
 	return error;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-04-04 16:53 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-04-04 17:01 [NFS] [PATCH] Corrects error patch in nfs_instantiate() Steve Dickson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox