mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "David S. Miller" <davem@redhat.com>
To: trond.myklebust@fys.uio.no
Cc: Linus Torvalds <torvalds@transmeta.com>,
	Linux Kernel <linux-kernel@vger.kernel.org>,
	NFS devel <nfs-devel@linux.kernel.org>
Subject: Re: Spinlocking patch for in xprt.c
Date: Sat, 13 Jan 2001 15:10:01 -0800 (PST)	[thread overview]
Message-ID: <14944.57417.917410.380225@pizda.ninka.net> (raw)
In-Reply-To: <14942.64595.157544.350302@charged.uio.no>
In-Reply-To: <14942.64595.157544.350302@charged.uio.no>


Trond, did you actually look at how this code works before
you made modifications to my fixes?

xprt_lock serializes sleep/wakeup sequences in the xprt code, so you
cannot remove xprt_lock from the sections where I added holding of
xprt_sock_lock to protect the state of xprt->snd_task.  So for
example, this part of your patch is completely bogus and will create
new corruptions and crashes:

@@ -1143,10 +1143,10 @@
 	struct rpc_xprt *xprt = task->tk_rqstp->rq_xprt;
 
 	if (xprt->snd_task && xprt->snd_task == task) {
-		spin_lock(&xprt_lock);
+		spin_lock_bh(&xprt_sock_lock);
 		xprt->snd_task = NULL;
 		rpc_wake_up_next(&xprt->sending);
-		spin_unlock(&xprt_lock);
+		spin_unlock_bh(&xprt_sock_lock);
 	}
 }

You _must_ hold both xprt_lock and xprt_sock_lock in this
section of code, not just one or just the other.

Linus, please do not apply this patch until these issues
are addressed.

Later,
David S. Miller
davem@redhat.com
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

  reply	other threads:[~2001-01-13 23:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-01-12 12:45 Trond Myklebust
2001-01-13 23:10 ` David S. Miller [this message]
2001-01-14 18:45   ` Trond Myklebust

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=14944.57417.917410.380225@pizda.ninka.net \
    --to=davem@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nfs-devel@linux.kernel.org \
    --cc=torvalds@transmeta.com \
    --cc=trond.myklebust@fys.uio.no \
    /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®