From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5F106C5B57D for ; Tue, 2 Jul 2019 08:15:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2D88F20645 for ; Tue, 2 Jul 2019 08:15:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1562055352; bh=FHZuVNPHrPEskjr4ytkC96O85qWn+vClIozAy1WdJBk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=ezLh2M2IEhH7lwYVAajMoeDNrcubjrNHkx/6FesRPiqEaJkbOh/rCghUwykHPgbs/ 20zUKIV6N59gQYqAua78MYL2CJJ80gyH5+MSvrgptkplasH9s7BdixQx8OeycwYiUL i6AneYZ46xl2s+Qxnu9qWAKmQetT3YBN42w1Hxdo= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728136AbfGBIPv (ORCPT ); Tue, 2 Jul 2019 04:15:51 -0400 Received: from mail.kernel.org ([198.145.29.99]:50088 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727756AbfGBIEe (ORCPT ); Tue, 2 Jul 2019 04:04:34 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1B8E821479; Tue, 2 Jul 2019 08:04:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1562054673; bh=FHZuVNPHrPEskjr4ytkC96O85qWn+vClIozAy1WdJBk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iZ26FpzoJ8rdCzkCD0stE3YIMp+X90hdY6AyzJFxIHvL6tklWPbOvYAp37cQgvozx P4JSfbRz2WgWebmzhVqmfGmb3lnWdwX86RwiSyyaH2vuYyIUuPRKGuYakpgKC32HfP wj8aZCOc3x5X7xtV7VwkLn59PHR7NU3EP3AQ6n74= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Will Deacon Subject: [PATCH 5.1 52/55] futex: Update comments and docs about return values of arch futex code Date: Tue, 2 Jul 2019 10:02:00 +0200 Message-Id: <20190702080126.770004015@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190702080124.103022729@linuxfoundation.org> References: <20190702080124.103022729@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Will Deacon commit 427503519739e779c0db8afe876c1b33f3ac60ae upstream. The architecture implementations of 'arch_futex_atomic_op_inuser()' and 'futex_atomic_cmpxchg_inatomic()' are permitted to return only -EFAULT, -EAGAIN or -ENOSYS in the case of failure. Update the comments in the asm-generic/ implementation and also a stray reference in the robust futex documentation. Signed-off-by: Will Deacon Signed-off-by: Greg Kroah-Hartman --- Documentation/robust-futexes.txt | 3 +-- include/asm-generic/futex.h | 8 ++++++-- 2 files changed, 7 insertions(+), 4 deletions(-) --- a/Documentation/robust-futexes.txt +++ b/Documentation/robust-futexes.txt @@ -218,5 +218,4 @@ All other architectures should build jus the new syscalls yet. Architectures need to implement the new futex_atomic_cmpxchg_inatomic() -inline function before writing up the syscalls (that function returns --ENOSYS right now). +inline function before writing up the syscalls. --- a/include/asm-generic/futex.h +++ b/include/asm-generic/futex.h @@ -23,7 +23,9 @@ * * Return: * 0 - On success - * <0 - On error + * -EFAULT - User access resulted in a page fault + * -EAGAIN - Atomic operation was unable to complete due to contention + * -ENOSYS - Operation not supported */ static inline int arch_futex_atomic_op_inuser(int op, u32 oparg, int *oval, u32 __user *uaddr) @@ -85,7 +87,9 @@ out_pagefault_enable: * * Return: * 0 - On success - * <0 - On error + * -EFAULT - User access resulted in a page fault + * -EAGAIN - Atomic operation was unable to complete due to contention + * -ENOSYS - Function not implemented (only if !HAVE_FUTEX_CMPXCHG) */ static inline int futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr,