Received: by 10.223.185.116 with SMTP id b49csp5544983wrg; Tue, 27 Feb 2018 15:33:25 -0800 (PST) X-Google-Smtp-Source: AH8x225kyHIDNZJ0GdzI6gnJG1NF/xjUbT6ZHOBTQillPrMMYNoduMKqlc9fq8FmzKs8AJgvt4Cl X-Received: by 2002:a17:902:51ee:: with SMTP id y101-v6mr16130277plh.157.1519774405032; Tue, 27 Feb 2018 15:33:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519774404; cv=none; d=google.com; s=arc-20160816; b=foFRh08sQO5IXvcwAn3uBURSm4hK3qYubOCpVK0aAxQqDRTjWBWX0GB3n2/NVTGs+k 5//ZO922ecS6AW60UpCuW9IDJG3zRYPuCWJTc5iPCK1whi2/YfpypjddQ8CCt4J4REbd Xqd02puzl2zwzGw86bLyLs2NYfHwl/J+qZgCYwBzfTNZQgXMeNP7KPBJUACyH8JtEUKe nfJfgBdbSEmdZ1a5HNfb8fzobbF11UGu+DiKTf/OIyO2rTyqdApNo4MlRGq8KnClpM/I B8T1c8fQr5GWyQ3maYCUfbpnuNYDcZ35y7etlazwY6sIrY9G5MC4soKW+IoscKPt3ccA C3pw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=7L2RI8was3SmE3190BI9MVaMFdT8dJb3y5+1rs84/UQ=; b=n1PU1fnoSyu18S+xnPmdYr7TDLf/CuDddC1HxRI51TK93plL2JWkOkDCBgEonjv0kJ nyEa/Bfwc/qIguffDBB4CAs5YbNH3B2b3BALj4yAIOaCxNipTfJceFHaiImkVmiupGtO b4cklWjsupRuFrL6TcPU0J8KNj04+sY58KXmgN84CQWMAaDb6LNRG6Xu56hO02A7y2ZR ZhUjZKcJpBdr9XQsuSrKA0un+mwYrWsScx3vp1AUzzY/oVWDbkyY/LMpARyi9F1/DiQd ZqwO1fhQg0gqmvACBkYBkBCci86oHOUvDLV1wpgS4xXdzjLMS6U+AvspPDZ4YU6v8Qdr fq4A== ARC-Authentication-Results: i=1; mx.google.com; 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 64si177309pgi.67.2018.02.27.15.33.10; Tue, 27 Feb 2018 15:33:24 -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; 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 S1751838AbeB0XcN (ORCPT + 99 others); Tue, 27 Feb 2018 18:32:13 -0500 Received: from hs01.dk-develop.de ([213.136.71.231]:42506 "EHLO hs01.dk-develop.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751632AbeB0XcC (ORCPT ); Tue, 27 Feb 2018 18:32:02 -0500 Received: from danilo-linux.fritz.box (ipbcc13fda.dynamic.kabel-deutschland.de [188.193.63.218]) by hs01.dk-develop.de (Postfix) with ESMTPSA id 5281F1320F6B; Wed, 28 Feb 2018 00:32:05 +0100 (CET) From: Danilo Krummrich To: mcgrof@kernel.org, keescook@chromium.org Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Danilo Krummrich Subject: [PATCH v2 2/2] fs/sysctl: remove redundant link check in proc_sys_link_fill_cache() Date: Wed, 28 Feb 2018 00:31:56 +0100 Message-Id: <20180227233156.29826-2-danilokrummrich@dk-develop.de> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180227233156.29826-1-danilokrummrich@dk-develop.de> References: <20180227233156.29826-1-danilokrummrich@dk-develop.de> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org proc_sys_link_fill_cache() does not need to check whether we're called for a link - it's already done by scan(). Signed-off-by: Danilo Krummrich --- v2: removed 'err' as it's only used for sysctl_follow_link() --- fs/proc/proc_sysctl.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/fs/proc/proc_sysctl.c b/fs/proc/proc_sysctl.c index 82ac5f682b73..d36ef667c0a8 100644 --- a/fs/proc/proc_sysctl.c +++ b/fs/proc/proc_sysctl.c @@ -712,12 +712,9 @@ static bool proc_sys_link_fill_cache(struct file *file, if (IS_ERR(head)) return false; - if (S_ISLNK(table->mode)) { - /* It is not an error if we can not follow the link ignore it */ - int err = sysctl_follow_link(&head, &table); - if (err) - goto out; - } + /* It is not an error if we can not follow the link ignore it */ + if (sysctl_follow_link(&head, &table)) + goto out; ret = proc_sys_fill_cache(file, ctx, head, table); out: -- 2.14.1