Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp670480yba; Thu, 18 Apr 2019 07:43:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqxSfeVHXqoEmolzKbfmBZsEulrH2dywH9c/+Y9hCUC4yR0lPmeqbMatb5PLEQhxczCvySeF X-Received: by 2002:a63:5b4b:: with SMTP id l11mr58661851pgm.95.1555598619720; Thu, 18 Apr 2019 07:43:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555598619; cv=none; d=google.com; s=arc-20160816; b=lgcIJkIGy97elGydncx02iLCpyHXZyQP1TvjxIKJ0+2pWq/XOxInbPATWbaEYlVyCq N+VPdGsBQUMvH/cglsWfLM952yGzQra3blWN4gVv1lBHpGzj8Hcb1kh4s/RrKJHgFSND A6VI/hh2br2sBAYFEIbhtFB7/7AxihoDYoALZug3l/bd0aTowD8lh0D3wR7wUCRCEIGw CT3PuSnsoHxXFyOqi2Me9QyvhTyYmGIzzvjzEec7Lz3FOlfUTfJTmgbMnKsVkg696Tx9 ye/n28XLJfABRlQ991N665KvwCxAigyLNXstjFEetbR1tnf8xwKn6430sNjPh+m1I20S khSA== 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:in-reply-to:references:message-id:cc:to:subject:from :dkim-signature:dkim-signature; bh=Vja9J+rviwQ640U9SB3zs3yDI0ULoZ4Pnzv2AfWAzFU=; b=aUk7H715iwXOCBxOkDy675ecnP+jYrOV6Ou0188FLNiXs4SEuXoQ513DIZaxRoFeU9 5VikXDgRhu+gPzNwUvzWrsPne8+rwt7itU1CFmIBoPhvtOUBFPXSDsuagRBjeoMSk0SJ NPi2+B/RoRgt93Khuubu7NeuplJ2qaKWgg4ZU/pVM+xuCl6KFM61WzcU+azUE0E79PxN FOXSdjKNcplSod5RMRQSYjHOzJjMTvVcOZmm+u7+xQus/h2Wo8Jdoctv9uCFKRIIE75W ZeXA4sJ7oLvZ5sZZ1LYBoP3FBRxkqPB/9+DG0s9TGKXyQGs03uLtgbu44WCDjsl61WVk 48Fg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nexedi.com header.s=mandrill header.b=E2bPLc6w; dkim=pass header.i=@mandrillapp.com header.s=mandrill header.b=Tlt1bTgz; 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 r24si2239829pls.398.2019.04.18.07.43.23; Thu, 18 Apr 2019 07:43:39 -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=E2bPLc6w; dkim=pass header.i=@mandrillapp.com header.s=mandrill header.b=Tlt1bTgz; 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 S2389057AbfDROmY (ORCPT + 99 others); Thu, 18 Apr 2019 10:42:24 -0400 Received: from mail18.wdc04.mandrillapp.com ([205.201.139.18]:10913 "EHLO mail18.wdc04.mandrillapp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388070AbfDROmY (ORCPT ); Thu, 18 Apr 2019 10:42:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; s=mandrill; d=nexedi.com; h=From:Subject:To:Cc:Message-Id:References:In-Reply-To:Date:MIME-Version:Content-Type:Content-Transfer-Encoding; i=kirr@nexedi.com; bh=Vja9J+rviwQ640U9SB3zs3yDI0ULoZ4Pnzv2AfWAzFU=; b=E2bPLc6wWRSD54LDk3G7PScdDZP89ig5rhDzFzDprNn4LuPJKhYJrYgn0NAGcLpWgLDvuea86zME KHhpPDCcNymXuKc6PWu+1e/kjk4MOCEYg/AYBPn6ILxt88+O5Aj/WC2dCxbYBn6LrYnarktBTREK Y5sSSmKxrWGPuzERBfY= Received: from pmta08.mandrill.prod.suw01.rsglab.com (127.0.0.1) by mail18.wdc04.mandrillapp.com id hn26cu1jvmgr for ; Thu, 18 Apr 2019 14:42:22 +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=1555598542; h=From : Subject : To : Cc : Message-Id : References : In-Reply-To : Date : MIME-Version : Content-Type : Content-Transfer-Encoding : From : Subject : Date : X-Mandrill-User : List-Unsubscribe; bh=Vja9J+rviwQ640U9SB3zs3yDI0ULoZ4Pnzv2AfWAzFU=; b=Tlt1bTgzNPHhzQXDYCE1O+1ioNvc+IS+7ZYA6GiXnhHS/pNZEusT0J+jKofl3eTXe0r805 /rHYWJN7xJ8vqlM6kbZE6z1NsNEZF1zDYXLJ195367y4lv9dqLZYsvfUOSAdk/X9NBvfJBqo fkoYUm5lYi6viTvCOmx8MnSGIevnM= From: Kirill Smelkov Subject: Re: [PATCH] pci/switchtec: fix stream_open.cocci warnings (fwd) Received: from [87.98.221.171] by mandrillapp.com id e0cf071d4de04239b47a967112b35bb2; Thu, 18 Apr 2019 14:42:22 +0000 To: Bjorn Helgaas Cc: Julia Lawall , Sebastian Andrzej Siewior , , Kurt Schwemmer , Logan Gunthorpe , , Message-Id: <20190418144215.GA25178@deco.navytux.spb.ru> References: <20190417215420.GV126710@google.com> <20190418103755.GA14294@deco.navytux.spb.ru> <20190418123730.GX126710@google.com> In-Reply-To: <20190418123730.GX126710@google.com> 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.e0cf071d4de04239b47a967112b35bb2 X-Mandrill-User: md_31050260 Date: Thu, 18 Apr 2019 14:42:22 +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 On Thu, Apr 18, 2019 at 07:37:30AM -0500, Bjorn Helgaas wrote: > On Thu, Apr 18, 2019 at 10:38:02AM +0000, Kirill Smelkov wrote: > > On Thu, Apr 18, 2019 at 07:31:02AM +0200, Julia Lawall wrote: > > > On Wed, 17 Apr 2019, Bjorn Helgaas wrote: > > > > On Sat, Apr 13, 2019 at 06:50:57PM +0200, Julia Lawall wrote: > > > > > Hello, > > > > > > > > > > Kirill will explain about this issue. > > > > > > > > > > julia > > > > > > > > > > ---------- Forwarded message ---------- > > > > > Date: Sat, 13 Apr 2019 11:22:51 +0800 > > > > > From: kbuild test robot > > > > > To: kbuild@01.org > > > > > Cc: Julia Lawall > > > > > Subject: [PATCH] pci/switchtec: fix stream_open.cocci warnings > > > > > > > > > > CC: kbuild-all@01.org > > > > > TO: Sebastian Andrzej Siewior > > > > > CC: Kurt Schwemmer > > > > > CC: Logan Gunthorpe > > > > > CC: Bjorn Helgaas > > > > > CC: linux-pci@vger.kernel.org > > > > > CC: linux-kernel@vger.kernel.org > > > > > > > > > > From: kbuild test robot > > > > > > > > > > drivers/pci/switch/switchtec.c:395:1-17: ERROR: switchtec_fops: .read() can deadlock .write(); change nonseekable_open -> stream_open to fix. > > > > > > > > > > Generated by: scripts/coccinelle/api/stream_open.cocci > > > > > > > > > > Fixes: 8a29a3bae2a2 ("pci/switchtec: Don't use completion's wait queue") > > > > > Signed-off-by: kbuild test robot > > > > > > > > Based on Kirill's subsequent email saying this is already queued to > > > > the merge window, I assume I need to do nothing here. > > > > > > > > I think a signed-off-by from a robot, i.e., not from a real person, is > > > > meaningless, and I don't think I would personally accept it. It's > > > > certainly OK to indicate that a patch was auto-generated, but I think > > > > a real person still needs to take responsibility for it. > > > > > > > > Documentation/process/submitting-patches.rst says it must contain a > > > > real name (no pseudonyms or anonymous contributions), and I don't > > > > think a robot fits in the spirit of that. > > > > > > > > I see that > > > > https://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-rt-devel.git/commit/?id=8a29a3bae2a2 > > > > (mentioned below) does have a good signed-off-by from Sebastian, but > > > > that's not *this* patch, so I don't know what's what. > > > > > > Normally, for these robot generated patches, when I approve them, I put my > > > own sign off, but under the robot one, since the robot has put a From > > > line. In this case, I handed the problem off to Kirill, so I didn't do > > > that. I agree that it would be good for Kirill to sign off on it. > > > > Just for the reference: I have put my signature on the mass converstion > > patch as well as ack's that were received: > > > > https://lab.nexedi.com/kirr/linux/commit/edaeb4101860 > > Looks good, thanks. Feel free to add my > > Acked-by: Bjorn Helgaas [drivers/pci/switch/switchtec] > > to the https://lab.nexedi.com/kirr/linux/commit/edaeb4101860 patch. > > It looks like maybe the commit log could use > > s/and the reset were/and the rest were/ Bjorn, thanks for feedback. I've added your ack and fixed that typo. > It also mentions "the previous patch" a couple times, which may lose > some of its meaning depending on how things get merged into git. If > that previous patch has already been merged, a SHA1 reference would be > more specific. Good point. Initially those patches were coming together, but the first one landed to master while the conversion is only scheduled to be done. I've changed this reference to 10dce8af3422 ("fs: stream_open - opener for stream-like files so that read and write can run simultaneously without deadlock"). > I would personally split that into two patches: one to avoid the > potential deadlocks and a second to do the "safe to change to > stream_open" changes. It seems like the first is more serious and > urgent while the second is more of a cleanup. Then you could > streamline the commit logs by including a single diagnostic and > omitting the entire list of files. I was contemplating how to split this too. And one of the way was to go with separate patch for every subsystem. However I still hope to do the mass conversion all at one conversion, because otherwise it would be many patches and it will take my time to propagate them all / ping maintainers etc. About splitting deadlock / just safe: stream_open.cocci does not have complete coverage for detecting whether a .read() blocks, and as pci/switchtec case shows there are indeed other cases that might be deadlocking but are not currently detected as such. I would thus prefer not to split the conversion. I've added the following note to the patch: and the rest were just safe to convert to stream_open because their read and write do not use ppos at all and corresponding file_operations do not have methods that assume @offset file access(*): ... (*) This second group also contains cases with read/write deadlocks that stream_open.cocci don't yet detect, but which are still valid to convert to stream_open since ppos is not used. For example drivers/pci/switch/switchtec.c calls wait_for_completion_interruptible() in its .read, but stream_open.cocci currently detects only "wait_event*" as blocking. hope it is ok. > But that's all bike-shedding and I'm totally fine with this as-is. Thanks. Your input was useful. The updated patch is here: https://lab.nexedi.com/kirr/linux/commit/a34a8a9cb2d7 as well as related patches to tighten stream_open semantic and corresponding FUSE bits: https://lab.nexedi.com/kirr/linux/commit/47ee8df337a9 https://lab.nexedi.com/kirr/linux/commit/1b4636172835 Kirill