From patchwork Thu Apr 9 07:11:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Hocko X-Patchwork-Id: 11481333 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4871D1392 for ; Thu, 9 Apr 2020 07:11:43 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 13FCF2075E for ; Thu, 9 Apr 2020 07:11:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 13FCF2075E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 416498E000E; Thu, 9 Apr 2020 03:11:42 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 39F7C8E0006; Thu, 9 Apr 2020 03:11:42 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2B5D28E000E; Thu, 9 Apr 2020 03:11:42 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0091.hostedemail.com [216.40.44.91]) by kanga.kvack.org (Postfix) with ESMTP id 1B8348E0006 for ; Thu, 9 Apr 2020 03:11:42 -0400 (EDT) Received: from smtpin15.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id E8535801C8E4 for ; Thu, 9 Apr 2020 07:11:41 +0000 (UTC) X-FDA: 76687446402.15.wish49_2be7286d25b19 X-Spam-Summary: 2,0,0,8f9533450c7483b2,d41d8cd98f00b204,mstsxfx@gmail.com,,RULES_HIT:41:355:379:541:800:960:973:988:989:1260:1311:1314:1345:1437:1515:1534:1540:1711:1730:1747:1777:1792:2393:2559:2562:2693:3138:3139:3140:3141:3142:3352:3865:3867:3868:3871:5007:6261:7576:7901:10004:11026:11658:11914:12043:12296:12297:12438:12517:12519:12555:12679:12895:13069:13161:13229:13311:13357:13894:14096:14181:14384:14394:14721:21080:21444:21451:21627:21990:30012:30054,0,RBL:209.85.128.67:@gmail.com:.lbl8.mailshell.net-66.100.201.100 62.18.0.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fp,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:15,LUA_SUMMARY:none X-HE-Tag: wish49_2be7286d25b19 X-Filterd-Recvd-Size: 3111 Received: from mail-wm1-f67.google.com (mail-wm1-f67.google.com [209.85.128.67]) by imf07.hostedemail.com (Postfix) with ESMTP for ; Thu, 9 Apr 2020 07:11:41 +0000 (UTC) Received: by mail-wm1-f67.google.com with SMTP id y24so3032570wma.4 for ; Thu, 09 Apr 2020 00:11:41 -0700 (PDT) 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:mime-version :content-transfer-encoding; bh=5eSqljophK3J9QMb2IVJwDYwOtfnnEmsDgtCr/TVwbc=; b=KnY/UJXfcRViQDzGkpZ3UhgLiXxbqnUdhdBr3TIMHk3yiAmUp+/EMQ4rw7hD2c9f1w BcNB55/kGTFJSkvk5jTyZBkYpSIsliqFjHP1ZzUuyYIzaGI+hNOLuP8iq9porQwCsBz7 S8shcG9h1ecqjqB0lJ/w2AI7LUNk3C48yFo+5ABWcUfLyZz80wa3B+ojrl6RF4sRgnoV dQtfz+QVVFw4rYRVfxdU5RtClc8GEClVC+1FW4f7Oobt0KYdmRXZtYzYsP4n0C2sRseJ igWmcVavfr9fzjkkV3mSGnL6VDSDLkNhOqzr1icVn5qFI7V3MPWb9insYFYVLX0VAbpu H2PQ== X-Gm-Message-State: AGi0PubNsOotmDxjssVUg+U2gi/y7oJh+DnvXO5EdBoIqNJUOeu2POFm d0Nf7gz6mIrjP3AVgxjRW+g= X-Google-Smtp-Source: APiQypJ9YxTqJw7coXnf6Q2zGizMBjvKOUWP9ykWZFEHY+j0GH24P0x9faxr/NX2H95YcLo04gU1BA== X-Received: by 2002:a1c:1904:: with SMTP id 4mr8426305wmz.21.1586416300444; Thu, 09 Apr 2020 00:11:40 -0700 (PDT) Received: from tiehlicka.suse.cz (ip-37-188-180-223.eurotel.cz. [37.188.180.223]) by smtp.gmail.com with ESMTPSA id v186sm2570051wme.24.2020.04.09.00.11.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Apr 2020 00:11:39 -0700 (PDT) From: Michal Hocko To: Andrew Morton Cc: Linus Torvalds , Peter Xu , Hillf Danton , , LKML , Michal Hocko Subject: [PATCH] mm, gup: return EINTR when gup is interrupted by fatal signals Date: Thu, 9 Apr 2020 09:11:33 +0200 Message-Id: <20200409071133.31734-1-mhocko@kernel.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Michal Hocko EINTR is the usual error code which other killable interfaces return. This is the case for the other fatal_signal_pending break out from the same function. Make the code consistent. ERESTARTSYS is also quite confusing because the signal is fatal and so no handling will happen before returning to the userspace. Signed-off-by: Michal Hocko --- mm/gup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/gup.c b/mm/gup.c index 6076df8e04a4..50681f0286de 100644 --- a/mm/gup.c +++ b/mm/gup.c @@ -1088,7 +1088,7 @@ static long __get_user_pages(struct task_struct *tsk, struct mm_struct *mm, * potentially allocating memory. */ if (fatal_signal_pending(current)) { - ret = -ERESTARTSYS; + ret = -EINTR; goto out; } cond_resched();