Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756767AbdCXKZF (ORCPT ); Fri, 24 Mar 2017 06:25:05 -0400 Received: from emiliocobos.net ([178.62.105.89]:43500 "EHLO emiliocobos.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752170AbdCXKY4 (ORCPT ); Fri, 24 Mar 2017 06:24:56 -0400 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Authentication-Results: mail.emiliocobos.net; dmarc=none header.from=crisal.io To: linux-kernel@vger.kernel.org, Benjamin LaHaise , linux-aio@kvack.org Cc: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Subject: [PATCH 2/2] fs/aio.c: use READ_ONCE instead of ACCESS_ONCE for kiocb->ki_cancel Date: Fri, 24 Mar 2017 11:14:52 +0100 Message-Id: <20170324101452.19832-2-emilio@crisal.io> X-Mailer: git-send-email 2.12.1 In-Reply-To: <20170324101452.19832-1-emilio@crisal.io> References: <20170324101452.19832-1-emilio@crisal.io> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 755 Lines: 26 This is suggested by checkpath, but thought that wasn't as trivial as the previous patch and deserved a bit more thought. AIUI, this should prevent the compiler reordering the assignment in the same way, so let's just use it. Signed-off-by: Emilio Cobos Álvarez --- fs/aio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/aio.c b/fs/aio.c index be0ca6d9a6b3..dce62ed78c5c 100644 --- a/fs/aio.c +++ b/fs/aio.c @@ -578,7 +578,7 @@ static int kiocb_cancel(struct aio_kiocb *kiocb) * actually has a cancel function, hence the cmpxchg() */ - cancel = ACCESS_ONCE(kiocb->ki_cancel); + cancel = READ_ONCE(kiocb->ki_cancel); do { if (!cancel || cancel == KIOCB_CANCELLED) return -EINVAL; -- 2.12.1