Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp2236106ybi; Sun, 9 Jun 2019 06:59:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqwKJ58yTj8SoYoTgBFUWkjq7+xd7CjcD9aBY+nunsfowM9xCGMr70wZUnKjJi6cxEM1aN6W X-Received: by 2002:a63:af44:: with SMTP id s4mr11587182pgo.411.1560088767861; Sun, 09 Jun 2019 06:59:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560088767; cv=none; d=google.com; s=arc-20160816; b=hnVxDFKXfvfSuIsnkWBx+WSXry0sklMP/Z8W+iuTpHOFxVA/KdPZwETfuh06sTp2bd XcCEunlCmArLUfEPHuHtYPrT7J4Tp1zMjG1zTOyqEahBCIXfC7XFUAjcO9bf4E/dN9kl cltecEUPEY8oWKjyIhcq92BTs9h4wDcjwJiWT1VPmbos5aplpTGioTgqNIvcPD6xXTL1 vLGz2GfLw75I9TPKjiuUg0LlVhFexvqoj8l27+oJhfwgXeGq1teYJFzLADuIpiy6bg93 XLxVuVQJK5HSS7DW3jybelHNh9mXJlSrANir1EWXM+x3OwF/qZs2z8gFKCCMv1sJThXl 8xSw== 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:message-id:cc:to:subject:from:dkim-signature:dkim-signature; bh=112cZkYq00mkGEI9ggEVbOXM3lgRmy7KLKo6Z1zIIFQ=; b=EcrZmKDOc9uljCcTuqK0I/fVh1DweccX1DmLC+F6+zpdORsEtU6OEcklLfi8gfGBPV T4JaVfxQEf7KVoHniEgZZ/ch8sUISflhg5/aNeWIpmuaeeEB16Yr3Wki5Giyu+ubp4FD c96Pkn/3gMxDF11CImN9/NZ55S7CimPDYOXX6jwQmz5dCISWLEJAxNmkuUP8Qdt0DtzG oAmDfFo6wveyq7oVTjJaiWecB8ir27EWpaa3jqc2LxiZ8AFWdfGIuvjaRQyDGTSoPH1O 8AKRd6yEFh7Hz94xeHJWuIG2XgdrL8YyIxIP6mCo35qMtVrz1t3j8m3/LbmDmHYXGA8z 1dBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nexedi.com header.s=mandrill header.b=ghR5pkUV; dkim=pass header.i=@mandrillapp.com header.s=mandrill header.b="oY/TV0Dr"; 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 e9si6982746pjs.108.2019.06.09.06.59.11; Sun, 09 Jun 2019 06:59:27 -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=ghR5pkUV; dkim=pass header.i=@mandrillapp.com header.s=mandrill header.b="oY/TV0Dr"; 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 S1728975AbfFIN5H (ORCPT + 99 others); Sun, 9 Jun 2019 09:57:07 -0400 Received: from mail177-30.suw61.mandrillapp.com ([198.2.177.30]:27120 "EHLO mail177-30.suw61.mandrillapp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728591AbfFIN5G (ORCPT ); Sun, 9 Jun 2019 09:57:06 -0400 X-Greylist: delayed 926 seconds by postgrey-1.27 at vger.kernel.org; Sun, 09 Jun 2019 09:57:05 EDT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; s=mandrill; d=nexedi.com; h=From:Subject:To:Cc:Message-Id:Date:MIME-Version:Content-Type:Content-Transfer-Encoding; i=kirr@nexedi.com; bh=112cZkYq00mkGEI9ggEVbOXM3lgRmy7KLKo6Z1zIIFQ=; b=ghR5pkUVZuGqxdGw6DdFAu+ImtQBLHG4LQC87MD6Q7gjvKPajZ5MgzWfz6AmuLXGwENq3O2t3sPr vpnQkXSjRHy4CohkZhYNsQr6/c8u0DHavOo91t15aJR+Ol8iEQD3wjcFjuUZr5gU3xUjW157APk6 r0SQp4s/HmK6Q4jbXfg= Received: from pmta06.mandrill.prod.suw01.rsglab.com (127.0.0.1) by mail177-30.suw61.mandrillapp.com id hvk83222rtk1 for ; Sun, 9 Jun 2019 13:39:13 +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=1560087553; h=From : Subject : To : Cc : Message-Id : Date : MIME-Version : Content-Type : Content-Transfer-Encoding : From : Subject : Date : X-Mandrill-User : List-Unsubscribe; bh=112cZkYq00mkGEI9ggEVbOXM3lgRmy7KLKo6Z1zIIFQ=; b=oY/TV0DrNxI4oQSDSwiDVwSMkVIDze/WWZI+VKyPCNSklBzEci1p6UdB8OT2Ok6RttQuJP HwWir4eT3PqagEFts+Cwb6X2yTgxDEvJjaPIabBXg8TedESVFoXxqhmfEs/3uyPfBLhUTsPa UYWGswpHmMzJC+DnXiF5u18Ilvne4= From: Kirill Smelkov Subject: [PATCH 4.4 0/2] Fix FUSE read/write deadlock on stream-like files Received: from [87.98.221.171] by mandrillapp.com id e6fe1265ba994e6b9bd9cc3b57857b70; Sun, 09 Jun 2019 13:39:13 +0000 X-Mailer: git-send-email 2.20.1 To: Cc: Sasha Levin , Greg Kroah-Hartman , Ben Hutchings , Linus Torvalds , Miklos Szeredi , , , Kirill Smelkov Message-Id: <20190609132443.9420-1-kirr@nexedi.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.e6fe1265ba994e6b9bd9cc3b57857b70 X-Mandrill-User: md_31050260 Date: Sun, 09 Jun 2019 13:39:13 +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 Hello stable team, Please consider applying the following 2 patches to Linux-4.4 stable tree. The patches fix regression introduced in 3.14 where both read and write started to run under lock taken, which resulted in FUSE (and many other drivers) deadlocks for cases where stream-like files are used with read and write being run simultaneously. Please see complete problem description in upstream commit 10dce8af3422 ("fs: stream_open - opener for stream-like files so that read and write can run simultaneously without deadlock"). The actual FUSE fix (upstream commit bbd84f33652f "fuse: Add FOPEN_STREAM to use stream_open()") was merged into 5.2 with `Cc: stable@vger.kernel.org # v3.14+` mark and is already included into 5.1, 5.0 and 4.19 stable trees. However for some reason it is not (yet ?) included into 4.14, 4.9, 4.4, 3.18 and 3.16 trees. The patches fix a real problem into which my FUSE filesystem ran, and which also likely affects OSSPD (full details are in the patches description). Please consider including the fixes into 4.4 (as well as into other stable trees - I'm sending corresponding series separately - - one per tree). Thanks beforehand, Kirill P.S. the patches have been already a bit discussed in stable context some time ago: https://lore.kernel.org/linux-fsdevel/CAHk-=wgh234SyBG810=vB360PCzVkAhQRqGg8aFdATZd+daCFw@mail.gmail.com/ https://lore.kernel.org/linux-fsdevel/20190424183012.GB3798@deco.navytux.spb.ru/ https://lore.kernel.org/linux-fsdevel/20190424191652.GE3798@deco.navytux.spb.ru/ ... Kirill Smelkov (2): fs: stream_open - opener for stream-like files so that read and write can run simultaneously without deadlock fuse: Add FOPEN_STREAM to use stream_open() drivers/xen/xenbus/xenbus_dev_frontend.c | 2 +- fs/fuse/file.c | 4 +- fs/open.c | 18 ++ fs/read_write.c | 5 +- include/linux/fs.h | 4 + include/uapi/linux/fuse.h | 2 + scripts/coccinelle/api/stream_open.cocci | 363 +++++++++++++++++++++++ 7 files changed, 394 insertions(+), 4 deletions(-) create mode 100644 scripts/coccinelle/api/stream_open.cocci -- 2.20.1