Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2747001yba; Mon, 6 May 2019 10:52:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqx1XwhkZrB6B+jKx12BzRKAV9ymkWtO3yfFjEnh9/OAg69E4OD/CCctj45/1NOo1Gsmt5Um X-Received: by 2002:a17:902:9686:: with SMTP id n6mr34590461plp.282.1557165145840; Mon, 06 May 2019 10:52:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557165145; cv=none; d=google.com; s=arc-20160816; b=TiOruDZ+bkH2HmuqX7ziVrytsObNfb4GwivbobJQA7WNaZdadeSey+aaZXqPmfA9pA Gezz6ISrhUjY5wthv6+r4kal+NZuFcViUQV9Y27ktGWWXmCV6zNGI5mVf/yh3EvahxOF Dny3ygkNxvcqNDOXV2sb90DgAdblUJ3jY38fnGowgGlCDVRcA8aDeOT+vKLqGfMBgUfy SGWKGYpUbqqtTUXuSRPiATQPGNamG0wQ/VsyUeabimzkiidLo2zxZSHYYdM/lHbWpdqU EeyqXPLFP2bY22q6qj3gQq9cxIthTq9kqFpPyL2jXGQbaTSQBRnbVT7Lj2LGIpWhLeUt q4gQ== 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 :date:references:in-reply-to:message-id:cc:to:subject:from :dkim-signature:dkim-signature; bh=qZUWN1kEJ7Nm/rElYRgeKRzf22qzOgyt1hGga7WcdSQ=; b=koTkAQY0OIJzFgxprq4k6h67H7iDIlIpl5RwqssysSVgbGHOBHWvaqEP2CGqw2RkAV VZeHbPCsgI35CNXxY2zpTujRPPcpWac8V3IBas/U9gUvt7BSmIPZmIomyLeY3IhvjCEK i5+aiVNtw26Ud630k8ata7M+7xdV0bhwGi+3VUbi9IOdVItNi9oh92dxilr1mgxOBfb2 J1IVN4lhn6TDuURbCec/QleIddFViqMn2Y2BttMV3RircDRqjIqL0D51AfMimpC1aIQX SPmzfh9Qf9OxYfX0ECiMWqvn52oFrz08mBNHIR7CNXfTG1UcBdsABTk4xvIG80TZ35uV vnkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nexedi.com header.s=mandrill header.b=gesTRIR6; dkim=pass header.i=@mandrillapp.com header.s=mandrill header.b=Sdc6lEhx; 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 x5si4574032plo.433.2019.05.06.10.52.09; Mon, 06 May 2019 10:52:25 -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=@nexedi.com header.s=mandrill header.b=gesTRIR6; dkim=pass header.i=@mandrillapp.com header.s=mandrill header.b=Sdc6lEhx; 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 S1726653AbfEFRuh (ORCPT + 99 others); Mon, 6 May 2019 13:50:37 -0400 Received: from mail133-31.atl131.mandrillapp.com ([198.2.133.31]:9935 "EHLO mail133-31.atl131.mandrillapp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726394AbfEFRug (ORCPT ); Mon, 6 May 2019 13:50:36 -0400 X-Greylist: delayed 904 seconds by postgrey-1.27 at vger.kernel.org; Mon, 06 May 2019 13:50:35 EDT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; s=mandrill; d=nexedi.com; h=From:Subject:To:Cc:Message-Id:In-Reply-To:References:Date:MIME-Version:Content-Type:Content-Transfer-Encoding; i=kirr@nexedi.com; bh=qZUWN1kEJ7Nm/rElYRgeKRzf22qzOgyt1hGga7WcdSQ=; b=gesTRIR6LDf8YcS9zLoRDJMivzaaBsbLOfZBe9CT9hI2eNC5lEq5DpzjVk06J2Yqwls68vtejVFP f4o1vG/Q9uI1nZuSBhMT92dWr9Fw1aZ/x4a59XFkKnkpPHNXTCoEJ07So1tFhfbcfqajdh//VxPp JL7yaLdzyQ2cZ+MHOZo= Received: from pmta02.mandrill.prod.atl01.rsglab.com (127.0.0.1) by mail133-31.atl131.mandrillapp.com id hq1pum1sar8v for ; Mon, 6 May 2019 17:20:46 +0000 (envelope-from ) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandrillapp.com; i=@mandrillapp.com; q=dns/txt; s=mandrill; t=1557163246; h=From : Subject : To : Cc : Message-Id : In-Reply-To : References : Date : MIME-Version : Content-Type : Content-Transfer-Encoding : From : Subject : Date : X-Mandrill-User : List-Unsubscribe; bh=qZUWN1kEJ7Nm/rElYRgeKRzf22qzOgyt1hGga7WcdSQ=; b=Sdc6lEhxvTqK/oRgEBz9bpOyYs3iJQ6uq3yJZh+l7IMYP+snij2yP3q8B73gJkNgJQVy55 WMXhgcOpvt4kDMdAvnu36udb3KzS13w31mice/OPo8fUF9ONxNZgcIxw6bDsINMqp5Tt7OnJ Ds+Vel3v1WfAe0JqNtNZUb7HpX1Qw= From: Kirill Smelkov Subject: [PATCH 1/3] dtlk: remove double call to nonseekable_open Received: from [87.98.221.171] by mandrillapp.com id f8d245da4ae841b3af7ef1de2104dc03; Mon, 06 May 2019 17:20:46 +0000 X-Mailer: git-send-email 2.20.1 To: Linus Torvalds Cc: Al Viro , Arnd Bergmann , Christoph Hellwig , Greg Kroah-Hartman , Pavel Machek , Rasmus Villemoes , Miklos Szeredi , , , Kirill Smelkov Message-Id: <184012ad69b275a17d6fa40a8d4dcf15ef76c4d2.1557162679.git.kirr@nexedi.com> In-Reply-To: References: X-Report-Abuse: Please forward a copy of this message, including all headers, to abuse@mandrill.com X-Report-Abuse: You can also report abuse here: http://mandrillapp.com/contact/abuse?id=31050260.f8d245da4ae841b3af7ef1de2104dc03 X-Mandrill-User: md_31050260 Date: Mon, 06 May 2019 17:20:46 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org dtlk_open currently has 2 calls to nonseekable_open which are both executed on success path. It was not hurting to make the extra call as nonseekable_open is only changing file->f_flags in idempotent way. However the first nonseekable_open is indeed both unneeded and looks suspicious. The first nonseekable_open was added in 6244f13c51 ("Fix up a couple of drivers - notable sg - for nonseekability."; 2004-Aug-7). The second nonseekable_open call was introduced in dc5c724584 ("Remove ESPIPE logic from drivers, letting the VFS layer handle it instead.; 2004-Aug-8). The latter patch being mass change probably missed to remove nonseekable_open that was introduced into dtlk_open the day before. Fix it: remove the extra/unneeded nonseekable_open call and leave the call to nonseekable_open only on the path where we are actually opening the file. Suggested-by: Pavel Machek Signed-off-by: Kirill Smelkov --- drivers/char/dtlk.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/char/dtlk.c b/drivers/char/dtlk.c index f882460b5a44..669c3311adc4 100644 --- a/drivers/char/dtlk.c +++ b/drivers/char/dtlk.c @@ -298,7 +298,6 @@ static int dtlk_open(struct inode *inode, struct file *file) { TRACE_TEXT("(dtlk_open"); - nonseekable_open(inode, file); switch (iminor(inode)) { case DTLK_MINOR: if (dtlk_busy) -- 2.20.1