Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3053677ybi; Tue, 2 Jul 2019 01:13:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqzlywChs+DPoUUynuKjvtYZLMG6s28T/C3X/8NdaD722Z4cdQ+HLkeUnkpyMaqjYIxzJ89E X-Received: by 2002:a17:902:b592:: with SMTP id a18mr34246885pls.278.1562055193612; Tue, 02 Jul 2019 01:13:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562055193; cv=none; d=google.com; s=arc-20160816; b=ja6j5pychR3HoSPwm/kJOW1e8hIKDgN+GU5G75p8dKyl/qSO5FY5Nu3X0RmOunb+wO B0icYGqeFMZejI74smRR6e09q6Oi0P1h61B73zBHrCMZC/ks5yAh+b6BaHkOFLIWsp/s 0jDcXhA5rdgZzs7jclTCbARhUI+/TSp+8GV4oJNDkZNd9BU264icGL4YdkZ/cqRXU9+N dtCH3GJT07VqD/R74D/zMI9QHqVzeX6w81egwCJSgs+MDfvKIrcF5locnFN5bCGlDw2G W4r/KRKqP/0ujrN8zKrBOP61oQB1uc4c6F7+sVqSGC8NufA1syxYnwewtjeugvgB4cWA YyUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=MgKBYedVmlJkYlgCCJHST89UjJ2AR1SUH+TA30bu/qQ=; b=QVUG9PNRJHBK9QdSubY9vubgcH1AXomr3Wv8qBJ6XLIYbStyLVy0XRGswm65SqspAe O6R2HN0rM9aLD+JyQHhKIAHqN5qQ4XAU4gDqeugdSsomrlsSdHd+yhSKvafBet/ttaYm MPEmPkRsK675mxvAJ82DMJMoQJzE/1UHnyQB/u8lIgheINE+zM8UCY1SkJ0pYHHC7Gal VT0i/SVOU4kv2OgT/Gxr2tEU+XxLvIoXXfnvOOm/ZkOTc6mGf/q0nuiIFrq4fvYPTsrp 6rf4+yzmF5zZx0ke1Fg3SO7ZLDf6nP/KOLhTtkL4sa58QKi8lf7yvSchalvyLXjqTKM0 v/5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=sq23KUQZ; 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 m39si12197712plg.155.2019.07.02.01.12.58; Tue, 02 Jul 2019 01:13:13 -0700 (PDT) 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=@kernel.org header.s=default header.b=sq23KUQZ; 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 S1728329AbfGBIL1 (ORCPT + 99 others); Tue, 2 Jul 2019 04:11:27 -0400 Received: from mail.kernel.org ([198.145.29.99]:58890 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728654AbfGBIK1 (ORCPT ); Tue, 2 Jul 2019 04:10:27 -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 DB6792184B; Tue, 2 Jul 2019 08:10:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1562055027; bh=FHZuVNPHrPEskjr4ytkC96O85qWn+vClIozAy1WdJBk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sq23KUQZLGtbBD1etvUvfcTPmkzz6vNv4e7WpGmm0MXawGlkKDxvlIv9wUVthTERy tBwDrbpqYcFP8LfXGC92QuWEh7onEwIMR5jBOY3OsxfpokWOY/NiAgmUSuPCMx4KJ+ DhCG1499HeMEc+sCkXDbm6REzQZyus+nCZOk+de0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Will Deacon Subject: [PATCH 4.14 42/43] futex: Update comments and docs about return values of arch futex code Date: Tue, 2 Jul 2019 10:02:22 +0200 Message-Id: <20190702080126.094515764@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190702080123.904399496@linuxfoundation.org> References: <20190702080123.904399496@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,