From patchwork Mon Jul 23 19:51:55 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 1228741 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 5BD253FD4F for ; Mon, 23 Jul 2012 19:52:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754741Ab2GWTwE (ORCPT ); Mon, 23 Jul 2012 15:52:04 -0400 Received: from mail-yw0-f46.google.com ([209.85.213.46]:57691 "EHLO mail-yw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754739Ab2GWTwB (ORCPT ); Mon, 23 Jul 2012 15:52:01 -0400 Received: by yhmm54 with SMTP id m54so5887521yhm.19 for ; Mon, 23 Jul 2012 12:52:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state; bh=zIfbgwQcD5AzBNxnOoOa3mgkmwqEEhDrgkOShXAOS0I=; b=VNAGvlqn73CRI7T7afxMMsYPIAZgTar+ABYdleWiOdyKtpttgcPTe2igOXa9ub8TQ1 Emk3Qhpi3JRJq/hDJuktk/yRkSOIMQjWKpTSdjMweoEXmLpD4j8b7oChG0SbRZCW7bsU +5c2XQdguCyFqNi6QBj+wgTZyFqT1x+juQEZ+i/aDJ7InX985M9OOx9w+ZViGwM7iUDz ICjEeFUkN4TghgwdoPgX38tsudjZ+bjvL8p50EY3ny8Bh2jJRWr4DJfQrGGUT+v4QpOv mQmdhsk6jh9inq6qjc1ccaD7IbCEUcC1j7txN9q0DQLWkmfRPT8Uwgp654FASakwnE8m 3x4w== Received: by 10.236.72.70 with SMTP id s46mr15699661yhd.108.1343073120598; Mon, 23 Jul 2012 12:52:00 -0700 (PDT) Received: from salusa.poochiereds.net (cpe-076-182-054-194.nc.res.rr.com. [76.182.54.194]) by mx.google.com with ESMTPS id p29sm26673457yhl.19.2012.07.23.12.51.59 (version=SSLv3 cipher=OTHER); Mon, 23 Jul 2012 12:52:00 -0700 (PDT) From: Jeff Layton To: trond.myklebust@netapp.com Cc: linux-nfs@vger.kernel.org Subject: [PATCH] sunrpc: clarify comments on rpc_make_runnable Date: Mon, 23 Jul 2012 15:51:55 -0400 Message-Id: <1343073115-29944-1-git-send-email-jlayton@redhat.com> X-Mailer: git-send-email 1.7.10.4 X-Gm-Message-State: ALoCoQn4tglPMWH7kaP+xllTmGx++O4MUWkBhOTyERBEN93e0AeKShD0aOiGQ8b5KhVW8cEy3DKm Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org rpc_make_runnable is not generally called with the queue lock held, unless it's waking up a task that has been sitting on a waitqueue. This is safe when the task has not entered the FSM yet, but the comments don't really spell this out. Signed-off-by: Jeff Layton --- net/sunrpc/sched.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/net/sunrpc/sched.c b/net/sunrpc/sched.c index eda32ae..1f19aa1 100644 --- a/net/sunrpc/sched.c +++ b/net/sunrpc/sched.c @@ -300,8 +300,9 @@ EXPORT_SYMBOL_GPL(__rpc_wait_for_completion_task); /* * Make an RPC task runnable. * - * Note: If the task is ASYNC, this must be called with - * the spinlock held to protect the wait queue operation. + * Note: If the task is ASYNC, and is being made runnable after sitting on an + * rpc_wait_queue, this must be called with the queue spinlock held to protect + * the wait queue operation. */ static void rpc_make_runnable(struct rpc_task *task) {