Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp130320imu; Mon, 26 Nov 2018 08:49:40 -0800 (PST) X-Google-Smtp-Source: AFSGD/W2Cm/L8asErl7lqfIQPM7gdAS8JT0ExrdT4W1XxD00Yon/MbL91dBc7QIELiK0Mfbb5B86 X-Received: by 2002:a63:da45:: with SMTP id l5mr25972665pgj.111.1543250980905; Mon, 26 Nov 2018 08:49:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543250980; cv=none; d=google.com; s=arc-20160816; b=vqnTCEW1fhmXrg1vgsS4PCF/b21iiUcIcvXS0l+EUrvX/Dd06Pbjw3fW5hmomuxJsX SlfF+pkgBFZPNJ/MCc7ssvwtw+mtUUeMQ9/0lFTXE215dqT9lWQTdSjXjWtM2WXkszMm PWJU1hrX9c7YUafaf4xIvZx25/zjyhOOco9kUxIl5xqfXBjLhRhrQmEjlBUUKcQ/tjc2 1QkRhTGGT7LCsnmGeDYfFLpUYz7wusOi3Pt0RO9/1VNkmW2peK0XSNs3ClPhwJqUqBFm DB0YPQxR12y8mlYVR/CLBqi3aD3jna89eyzR4c29dDY2805ICz2ke9l+94KMDbVphUTE TPHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=8evddiikL3tOqy/f4zVT9/kxTqkXqGrvFI9LY5FHVe0=; b=vSyhs6Gwe87XEFceJA881GXNUu0rlKxqGKxn7+rdkVza9K0pr+MWQGcZIhqyL9jgVx KXC1Z+upJgYtE48wWLJ9vwEVo+J++wC8Q4sFf9Mql6fPC5uWhbEbR1XGUiCBnae2DMz/ qddSGr48cXLYB2DPyJmAIl8NmxHKj3YDGwJY+ZptYVUcyOHbLoTBcVrrKAeCZoG9Kc2E pS9D+XbNLWtIEhykZty0iPdfUvbywPPRbxLSgymv5tEmSbSzLK0fSXXkQr3cBcE4r6xQ 0zL27008jktMkvspnv/39boWr6iZ+/ZOQkyzpx0a4IEmpWIIX7XtReq7EdToCGyoAV0B Dh/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=ECCikKGV; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s4si726391pga.377.2018.11.26.08.49.11; Mon, 26 Nov 2018 08:49:40 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=ECCikKGV; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726418AbeK0DjF (ORCPT + 99 others); Mon, 26 Nov 2018 22:39:05 -0500 Received: from mail-ed1-f67.google.com ([209.85.208.67]:36710 "EHLO mail-ed1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726203AbeK0DjE (ORCPT ); Mon, 26 Nov 2018 22:39:04 -0500 Received: by mail-ed1-f67.google.com with SMTP id f23so16442434edb.3 for ; Mon, 26 Nov 2018 08:44:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id; bh=8evddiikL3tOqy/f4zVT9/kxTqkXqGrvFI9LY5FHVe0=; b=ECCikKGVD+N3PsqCd5E+Pbym0YTKSHWI8O6+I32D0JDezLaJ4vCJszkqzU7KMyjbOk FCU5UY9njvUVPdZBctHXYvfBFJlnxFk0DHFTJpXqbLaCETmEwinxulC8Dd8d3VEBDRVW mNCdhZ3Y1m7D5ZcmU9zksZdX4zWSrrc+frIeM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=8evddiikL3tOqy/f4zVT9/kxTqkXqGrvFI9LY5FHVe0=; b=ePswq/mXaFEDzEvaKWovDqJgoX8VKDBy/bw5w1Q8EpK8gsDp3IRo6iTHR89gCWFGCF kWCJpT84KOd7T/AzUXpLDSVOF66c8aJKcMLuuYT+Q+fzwX1lLGiaZw19ifT1ui5gVJxe FfaAOhUBMxX9tyOBxfLLUQYHFX0Fb54MH5MDED5494BhhNqHXU61e60jpl32Mm3ZtPYx Lys68Ztax7VBJ3oANy082xjQ7+bkLQRMKAr3OHG1191twSDw7Yoi1lYheYV4CrTcaq+p Fmz64xnhyPrWjYeQapEF83ulFdd5m0+mxSDIKlOI7sAT3YlEbjwo9PBLhIXWXZHEV1Ul ME1A== X-Gm-Message-State: AGRZ1gK1H9CLaWs1JO7v+UI16MDuBGgJQ60LpfoHkGVDeCEMagKDhTJw hIWHKiZIbZtRHT5TQU16+tS6OA== X-Received: by 2002:a17:906:7a9c:: with SMTP id f28-v6mr20925980ejo.135.1543250665013; Mon, 26 Nov 2018 08:44:25 -0800 (PST) Received: from andrea.amarulasolutions.com (85.100.broadband17.iol.cz. [109.80.100.85]) by smtp.gmail.com with ESMTPSA id k32sm297995edb.42.2018.11.26.08.44.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 26 Nov 2018 08:44:24 -0800 (PST) From: Andrea Parri To: David Howells Cc: linux-afs@lists.infradead.org, linux-kernel@vger.kernel.org, Andrea Parri Subject: [PATCH] afs: Add missing memory barriers in afs_manage_cell() Date: Mon, 26 Nov 2018 17:44:12 +0100 Message-Id: <20181126164412.11184-1-andrea.parri@amarulasolutions.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org As the comments for wake_up_bit() and waitqueue_active() point out, the barriers are needed to order the clearing of the _FL_NOT_READY bit and the waitqueue_active() load; match the implicit barrier in prepare_to_wait(). Signed-off-by: Andrea Parri --- fs/afs/cell.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/afs/cell.c b/fs/afs/cell.c index cf445dbd5f2e0..a9488abe56029 100644 --- a/fs/afs/cell.c +++ b/fs/afs/cell.c @@ -637,6 +637,7 @@ static void afs_manage_cell(struct work_struct *work) cell->state = AFS_CELL_ACTIVE; smp_wmb(); clear_bit(AFS_CELL_FL_NOT_READY, &cell->flags); + smp_mb__after_atomic(); /* see comment for wake_up_bit() */ wake_up_bit(&cell->flags, AFS_CELL_FL_NOT_READY); goto again; @@ -678,6 +679,7 @@ static void afs_manage_cell(struct work_struct *work) cell->state = AFS_CELL_ACTIVE; smp_wmb(); clear_bit(AFS_CELL_FL_NOT_READY, &cell->flags); + smp_mb__after_atomic(); /* see comment for wake_up_bit() */ wake_up_bit(&cell->flags, AFS_CELL_FL_NOT_READY); _leave(" [deact->act]"); return; -- 2.17.1