mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Trond Myklebust <trond.myklebust@fys.uio.no>
To: Linus Torvalds <torvalds@transmeta.com>,
	Alexander Viro <viro@parcelfarce.linux.theplanet.co.uk>
Cc: Linux Kernel <linux-kernel@vger.kernel.org>
Subject: [PATCH] First casuality of hlist poisoning in 2.5.70
Date: Wed, 11 Jun 2003 16:34:25 -0700	[thread overview]
Message-ID: <16103.48257.400430.785367@charged.uio.no> (raw)


Hi,

  This patch removes the Oops that occurs when either the source or
the target of a d_move() operation is unhashed. It is currently
triggered by the NFS sillyrename code.

Cheers,
  Trond

--- linux-2.5.70-up/fs/dcache.c.orig	2003-06-07 10:17:01.000000000 -0700
+++ linux-2.5.70-up/fs/dcache.c	2003-06-11 16:11:56.000000000 -0700
@@ -1223,8 +1223,13 @@
 	/* Move the dentry to the target hash queue, if on different bucket */
 	if (dentry->d_bucket != target->d_bucket) {
 		dentry->d_bucket = target->d_bucket;
-		hlist_del_rcu(&dentry->d_hash);
-		hlist_add_head_rcu(&dentry->d_hash, target->d_bucket);
+		if (!hlist_unhashed(&dentry->d_hash))
+			hlist_del_rcu(&dentry->d_hash);
+		if (!hlist_unhashed(&target->d_hash)) {
+			hlist_add_head_rcu(&dentry->d_hash, target->d_bucket);
+			dentry->d_vfs_flags &= ~DCACHE_UNHASHED;
+		} else
+			dentry->d_vfs_flags |= DCACHE_UNHASHED;
 	}
 
 	/* Unhash the target: dput() will then get rid of it */

             reply	other threads:[~2003-06-11 23:20 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-06-11 23:34 Trond Myklebust [this message]
2003-06-11 23:50 ` Linus Torvalds
2003-06-12  0:04   ` Trond Myklebust
2003-06-12  0:32     ` Linus Torvalds
2003-06-12  5:22 ` Linus Torvalds
2003-06-12  6:04   ` Trond Myklebust
2003-06-12  7:30   ` Trond Myklebust
2003-06-12 16:26   ` viro
2003-06-19 23:01     ` Paul E. McKenney

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=16103.48257.400430.785367@charged.uio.no \
    --to=trond.myklebust@fys.uio.no \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@transmeta.com \
    --cc=viro@parcelfarce.linux.theplanet.co.uk \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®