From: Steve Dickson <SteveD@redhat.com>
To: nfs@lists.sourceforge.net
Subject: [PATCH] Corrects error path in nfs_instantiate()
Date: Fri, 04 Apr 2003 12:11:19 -0500 [thread overview]
Message-ID: <3E8DBCB7.20305@RedHat.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 289 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: 677 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;
reply other threads:[~2003-04-04 17:11 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3E8DBCB7.20305@RedHat.com \
--to=steved@redhat.com \
--cc=nfs@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.